TMK Alt Controller for FC660CPremade controlller is
Still available here (2023-02-18)https://geekhack.org/index.php?topic=90317.0GoalTo get programmability by replacing controller of Leopold FC660C with my own version.How to open caseYou have to void warranty from manufacturer to do this mod, of course.
More
Step 1: Void your warranty with getting rid of sticker and unscrew.
Step 2: Crack it open using tool like phone openner with care.
Step3: Done!
AnalysisReverse engineering work on the keyboard had happened by some people in this thread for these few years.
https://geekhack.org/index.php?topic=54222.0More
Pics of FC660C:
https://imgur.com/a/UTR8ZFCC docs:
https://fccid.io/RPKFCController board Dimensions: 98.3mm x 35.0mm
Schematic:
https://fccid.io/pdf.php?id=1888185* CPU: Fujitsu/Cypress F2MC-16LX MB90F337 -
http://www.huazhoucn.com/propic/ds90335-ds07-13735-2e.pdf* 20-contacts connector: Hirose DF14A-20P-1.25H -
http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf* 10-contacts connector: JST SM10B-SRSS-TB -
http://www.jst-mfg.com/product/pdf/eng/eSH.pdfSwitch board Schematic:
https://fccid.io/pdf.php?id=1888185* 20-contacts connector: Hirose DF14A-20P-1.25H -
http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf* LV07A -
http://www.ti.com/lit/ds/symlink/sn74lv07a.pdf* LV138A -
http://www.ti.com/lit/ds/symlink/sn74lvc138a.pdf* LV4051A -
http://www.ti.com/lit/ds/symlink/sn74lv4051a.pdf* AD5258:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5258.pdfConnector Pinouts
|Switch |Controller |
| board | board |Description |Schematic
|--------|-----------|--------------------------------------|-----------
| 1 |20 | FG |FG
| 2 |19 | GND |GND
| 3 |18 | GND |GND
| 4 |17 | 3.3V |V33
| 5 |16 | 5V |Vcc
| 6 |15 |*Z6-TP1684-4-HYS(o) |FBSTB
| 7 |14 |*Z6-TP1684-2-KEY(i) |OUT
| 8 |13 |*Z2-AD5258-5-SCL(I2C) |SCL
| 9 |12 |*Z2-AD5258-4-SDA(I2C) |SDA
|10 |11 |*Z4-LV4051A-6-~EN(Col 0-7) |INH_1
|11 |10 |*Z5-LV4051A-6-~EN(Col 8-F) |INH_2
|12 | 9 |+Z7-LV07A-5 (LV4051A-9-C) |SEL_C
|13 | 8 |+Z7-LV07A-1 (LV4051A-10-B) |SEL_B
|14 | 7 |+Z7-LV07A-3 (LV4051A-11-A) |SEL_A
|15 | 6 |+Z3-LVC138A-3-C |COL4
|16 | 5 |+Z3-LVC138A-2-B |COL3
|17 | 4 |+Z3-LVC138A-1-A |COL2
|18 | 3 |+Z3-LVC138A-4-~G2A Z6-TP1684-5-~EN |COL1
|19 | 2 |+Z7-LV07A-11-~InsertLED |LED1
|20 | 1 |+Z7-LV07A-13-~CapsLED |LED2
```
* 5V intferface
+ 3.3V interface
```
DigipotYou can communicate with AD5258 via I2C through 8 and 9 pins, though this is not needed for normal use of the keyboard.
You can tune actuation point by changing resistance of the digipot. But this may be in danger of making your keyboard unusable accidentally, firmware won't offer this feature at this point.
You can see test codes here, this works well for me somehow but try at your own risk.
https://github.com/tmk/tmk_keyboard/blob/fc660c_i2c/keyboard/fc660c/unimap_i2c.cFork fc660c_i2c branch and run 'make -f Makefile.i2c' in fc660c directory to build firmware.
// !!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!
// Writing improper value to EEPROM may mess your keyboard and
// it will require some hassles to recover it.
//
// CHECK DATASHEETS SCHEMATICS AND CODES BEFORE TRYING.
// !!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!
3.3V powered chipsLV07A(Z1, Z7) and LVC138A(Z3) work with 3.3V Vcc and receive 3.3V level inputs originally. But in fact they can work only with 5V supply by connecting 5V with 4pin instead of 3.3V.
I beleive giving 5V power with the chips doesn't harm those chips physically because it is within "Absolute Maximum Ratings". Moreover, 5V Vcc on LV07A meets "Recommended Operating Conditions" completely and nothing wrong there. But note that 5V powered LVC138A is out of its "Recommended Operating Conditions" and it may affect reliability of operation slightly.
On the other hand, inputs of both chips are 5V tolerant, it is completely safe to interface using 5V I/O microcontroller even when the chips are powered with 3.3V. You don't have to use 3.3V I/O.
You can choose whether you use 3.3V voltage regulator or not depending your preference or precaution.
How to scan switchesThis code emulates what original controller does on scanning.
https://github.com/tmk/tmk_keyboard/blob/472a60c40d32469197c168b8ec488e85c6efaa4f/keyboard/fc660c/fc660c.c#L66-L124More
Logic analyzer pics of matrix scanFrom these waveforms You will get idea about how to scan switches on the keyboard.
Close up:
Overall:
Switch matrix
| |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |A |B |C |D |E |F |
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
| 0|Q |W |E |Tab |R |U |T |Y |O |P |[ |I |] | |\ |Del |
| 1|1 |2 |3 |Esc |4 |7 |5 |6 |9 |0 |- |8 |= | |BSpc|Ins |
| 2| |LWin|LAlt|LCtl| | | |Spc |RAlt| |RCtl| |Fn |Down|Left|Rght|
| 3| |Z |X |LSft|C |N |V |B |, |. |/ |M |RSft|Up | | |
| 4|A |S |D |Caps|F |J |G |H |L |; |' |K | | |Entr| |
| 5| | | | | | | | | | | | | | | | |
| 6| | | | | | | | | | | | | | | | |
| 7| | | | | | | | | | | | | | | | |
Row5-7 have no key, you can omit scaning on those lines. Topre original controller scans those rows for some reason.
Row designationLV138A(Z3) selects a row line and gives strobe by enabling with ~G2A(18).
|Row |A/17|B/16|C/15|
|----|----|----|----|
|0 |0 |0 |0 |
|1 |1 |0 |0 |
|2 |0 |1 |0 |
|3 |1 |1 |0 |
|4 |0 |0 |1 |
|5 |1 |0 |1 |
|6 |0 |1 |1 |
|7 |1 |1 |1 |
Column designationLV4051A(Z4, Z5) select one of 16 column lines to sense capacitance of switches.
|Col |A/14|B/13|C/12|Z4-EN/10|Z5-EN/11|
|----|----|----|----|--------|--------|
|0 |0 |0 |0 |0 |1 |
|1 |1 |0 |0 |0 |1 |
|2 |0 |1 |0 |0 |1 |
|3 |1 |1 |0 |0 |1 |
|4 |0 |0 |1 |0 |1 |
|5 |1 |0 |1 |0 |1 |
|6 |0 |1 |1 |0 |1 |
|7 |1 |1 |1 |0 |1 |
|8 |0 |0 |0 |1 |0 |
|9 |1 |0 |0 |1 |0 |
|A |0 |1 |0 |1 |0 |
|B |1 |1 |0 |1 |0 |
|C |0 |0 |1 |1 |0 |
|D |1 |0 |1 |1 |0 |
|E |0 |1 |1 |1 |0 |
|F |1 |1 |1 |1 |0 |
Make Alt controllerNow that you can get all of information to make your own controller for FC660C from here and there, post in this thread to share your findings and ideas.
HarnessTo get connected to switch board you will need cable with Hirose DF14 series connector.
More
I made harness like this for prototyping on bread board but it was tedious and diffifult to crimp its contacts with wires.
Instead, I could use original cables with DF14 receptacle and solder wires on there, it would be far easier.
Or you can find cable on ebay. Search with "DF14 20P".
ConnectionBasically you need just 15 5V I/O pins from your favorite microcontroller to connect them with DF14 connector. Easy.
More
I used very plain dev board with ATMega32U4 for bread board protyping. And this is photo and example of pin configuration for the microcontroller.
Prototype on bread board in action.
|Switch | |
| board |Description |ATmega32u4
|--------|------------------------------------------|-----------
| 1 | FG |GND
| 2 | GND |GND
| 3 | GND |GND
| 4 | 3.3V |3.3V/5V
| 5 | 5V |5V
| 6 |*Z6-TP1684-4-HYS(o) |PC7
| 7 |*Z6-TP1684-2-KEY(i) |PC6
| 8 |*Z2-AD5258-5-SCL(I2C) |PD0(TWI)
| 9 |*Z2-AD5258-4-SDA(I2C) |PD1(TWI)
|10 |*Z4-LV4051A-6-~EN(Col 0-7) |PB4
|11 |*Z5-LV4051A-6-~EN(Col 8-F) |PB3
|12 |+Z7-LV07A-5 (LV4051A-9-C) |PB2
|13 |+Z7-LV07A-1 (LV4051A-10-B) |PB1
|14 |+Z7-LV07A-3 (LV4051A-11-A) |PB0
|15 |+Z3-LVC138A-3-C |PD6
|16 |+Z3-LVC138A-2-B |PD5
|17 |+Z3-LVC138A-1-A |PD4
|18 |+Z3-LVC138A-4-~G2A Z6-TP1684-5-~EN |PD7
|19 |+Z7-LV07A-11-~InsertLED |PB5
|20 |+Z7-LV07A-13-~CapsLED |PB6
This is circuit schematic of TMK Alt controller, for reference.
fc660c_controller.pdf (40.38 kB - downloaded 761 times.)
FirmwareTMK firmware supports FC660C Alt controller of ATMega32U4 now.
https://github.com/tmk/tmk_keyboard/tree/master/keyboard/fc660cTMK Keymap Editor is availablePlain keymap:
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?fc660cEmulation keymap: This emulates FC660C stock behaviour on Esc/~`, Fn+Esc and Fn+q.
http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?fc660c_emuHow to control LEDsYou can't change LED behaviour with Keymap Editor.
In 'Plain' keymap firmware Capslock LED indicates its key status and Insert one is not controlled at all.
In 'Emulation' keymap firmware Capslock LED indicates its key status and Insert one is lit when Layer1 is enabled.
Capslock and Insert LED are connected to PB6 and PB5 respectively. You can control them as you want by writing small code. Refer to these files.
https://github.com/tmk/tmk_keyboard/blob/f8276ddb57c8b13931c3889a0b50711ea20c5d3d/keyboard/fc660c/unimap_emu.c#L57-L65https://github.com/tmk/tmk_keyboard/blob/4befc879f68bf09421071f81138cd3665e625f28/keyboard/fc660c/fc660c.c#L129-L136Note-
Actuation point adjustment See this post.
https://geekhack.org/index.php?topic=88439.msg2403275#msg2403275