Goal

To get programmability by replacing controller of Leopold FC660C with my own version.

How to open case

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!



Void your warranty with getting rid of sticker and unscrew.Crack it open using tool like phone openner with care.Done!

Analysis

More



FCC docs:



Controller board





Dimensions: 98.3mm x 35.0mm

Schematic:



* CPU: Fujitsu/Cypress F2MC-16LX MB90F337 -

* 20-contacts connector: Hirose DF14A-20P-1.25H -

* 10-contacts connector: JST SM10B-SRSS-TB -





Switch board





Schematic:

* 20-contacts connector: Hirose DF14A-20P-1.25H -

* LV07A -

* LV138A -

* LV4051A -

* AD5258:





Connector Pinouts



Quote

|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

```







Digipot

You 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.c



Fork 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 chips

LV07A(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.

Pics of FC660C: https://imgur.com/a/UTR8Z FCC docs: https://fccid.io/RPKFC Dimensions: 98.3mm x 35.0mmSchematic: 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.pdf 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.pdf You 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.Fork 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!!!!!!!!!!!!!!!!!!!!!LV07A(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 switches

More



Logic analyzer pics of matrix scan

From these waveforms You will get idea about how to scan switches on the keyboard.



Close up:





Overall:









Switch matrix

Quote

| |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 designation

LV138A(Z3) selects a row line and gives strobe by enabling with ~G2A(18).



Quote

|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 designation

LV4051A(Z4, Z5) select one of 16 column lines to sense capacitance of switches.



Quote

|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 |



From these waveforms You will get idea about how to scan switches on the keyboard.Close up:Overall:Row5-7 have no key, you can omit scaning on those lines. Topre original controller scans those rows for some reason.LV138A(Z3) selects a row line and gives strobe by enabling with ~G2A(18).LV4051A(Z4, Z5) select one of 16 column lines to sense capacitance of switches.

Make Alt controller

More







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".

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".

More









Prototype on bread board in action.





Quote

|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

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.

Firmware

TMK Alt Controller for FC660C

Still available here (2020-01-15)

Note

You have to void warranty from manufacturer to do this mod, of course.Reverse engineering work on the keyboard had happened by some people in this thread for these few years.This code emulates what original controller does on scanning.Now 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.To get connected to switch board you will need cable with Hirose DF14 series connector.Basically you need just 15 5V I/O pins from your favorite microcontroller to connect them with DF14 connector. Easy.This is circuit schematic of TMK Alt controller, for reference. fc660c_controller.pdf (40.38 kB - downloaded 165 times.)TMK firmware supports FC660C Alt controller of ATMega32U4 now.You don't have enough time and decent tools to do this but own plenty of money in your pocket?OK. OK. Premade controlller isSee this post. https://geekhack.org/index.php?topic=88439.msg2403275#msg2403275