Author Topic: Help me reverse-eng a capacitive FC660C  (Read 45413 times)

0 Members and 1 Guest are viewing this topic.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Help me reverse-eng a capacitive FC660C
« on: Sun, 02 February 2014, 05:21:00 »
Okay I'm up to the task... almost. I got another FC660C but I totally need to replace the controller (actually I'd just need to replace the FN position but still).

The keyboard is very close to the HHKB internally. It seems to have two controllers, one on the PCB that takes care of the key scanning and one on the daughter board that connects to the USB and do the magic.

The connector is also similar to those of the HHKB but it has 20 pins (I already sourced that). Can anyone (Soarer? Hasu?) help me reverse engineer this thing? We might add it to the TMK firmware if we succeed.

This is the PCB header



This is the daughter board header



Pins 1 to 20 on the daughter board are connected in reverse order on the PCB.

On the daughter board:
Pins 20, 19, 18 seem to be ground.
No clue about 17 and 16.

I believe I can find VCC with a multimeter. It could be PIN 1 and 2 (?) All the others should be the matrix.

Can someone give me some directions/help? I'm totally in for making the whole process public for everyone to replicate.

Thanks

Offline Tranquilite

  • Posts: 144
Re: Help me reverse-eng a capacitive FC660C
« Reply #1 on: Sun, 02 February 2014, 12:03:58 »
Assuming that this ribbon sends rows/columns, the "easiest" method I can think of to reverse engineer it is to disconnect one pin at a time, and then press every key to try and puzzle out which row/column is no longer functioning. The tricky part is figuring out how to disconnect just one pin at a time.

If you have an oscilloscope, you could probably just connect it to each pin, and if it is being strobed on a consistent basis then it is a column (or row), and if it only is active when a key is pressed then it is a row (or column).

Though just to clarify, this is based off of theory rather than actual experience as I have never reverse engineered a switch matrix before.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #2 on: Sun, 02 February 2014, 12:09:11 »
I can probably find all the keys with a multimeter pressing one key at a time. it would be time consuming, but doable.

I need to figure out what are the additional pins AND how to code the firmware...

Offline mooswa

  • Posts: 153
  • Location: CA
Re: Help me reverse-eng a capacitive FC660C
« Reply #3 on: Sun, 02 February 2014, 12:16:21 »
The other pins will probably be leds and USB.  Check with bpiphany who has done similar tracing for other keyboards.  He might guide you.

http://deskthority.net/wiki/Controller_matrix_traces

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #4 on: Sun, 02 February 2014, 12:41:02 »
This will be very similar to the HHKB. See hasu's notes.

What you need to trace is where each pin on the connector goes - which will be to the various chips on the matrix PCB, not the switches. Some lines might go to more than one chip.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #5 on: Sun, 02 February 2014, 17:27:37 »
This will be very similar to the HHKB. See hasu's notes.

What you need to trace is where each pin on the connector goes - which will be to the various chips on the matrix PCB, not the switches. Some lines might go to more than one chip.

oh that makes sense! thanks. tomorrow I'll try to trace all the tracks... hopefully it's not too different from the HHKB

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Help me reverse-eng a capacitive FC660C
« Reply #6 on: Mon, 03 February 2014, 22:03:47 »
This will be very similar to the HHKB. See hasu's notes.

What you need to trace is where each pin on the connector goes - which will be to the various chips on the matrix PCB, not the switches. Some lines might go to more than one chip.

oh that makes sense! thanks. tomorrow I'll try to trace all the tracks... hopefully it's not too different from the HHKB

also, if you want to take good pictures of the PCB, that'll help

One thing: In your OP, you say "On the daughter board: Pins 20, 19, 18 seem to be ground." 19 and 18 do appear to be ground (though it'd be easier to tell with a full PCB photo), but I'm almost positive 20 is different from 19 and 18.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #7 on: Mon, 03 February 2014, 22:33:39 »
i don't see any logic on the pcb as far as that picture shows. it looks like it's just a bunch of filter caps. i haven't read hasu's notes (i should, as i'm sure they are invaluable), but from those pics:

1) you're going to need a scope for this, as the signals are very time variant.

2) tracing the matrix once you have a scope hanging off each pin shouldn't be too hard. (this thing is operational right?) like you said, hold down each key and then strobe all the pins. two pins should be going crazy. that's that key's position in the matrix.

3) i see what looks like an OPA as the closest IC to the wire harness. if possible, grab signal from the high side of the OPA and not the low.

has hasu dumped the firmware on either of the controllers and taken a look at it yet? the usb PHY can safely be ignored for the purposes of REing the switch matrix. but it looks to me like the other controller is doing the fairly reasonable task of strobing the matrix and then looking at the amped output for pins going crazy.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #8 on: Tue, 04 February 2014, 01:45:47 »
Thanks for your help, guys.

The PCB has at least 6 chips/controllers around (so it seems a little bit more complicated than the HHKB). I say "at least" because I haven't unscrewed the plate yet so I don't know what's on the other side.

Anyway today I'll try to trace everything and eventually post hi-res pictures. I did some quick tests and it doesn't seem a mission impossible.

@dorkvader, I tested 20, 19, 18 with a multimeter and they indeed all seem to go to ground. Anyway thanks for the heads up, I'll triple check that :) I'm definitely not an expect electrician :P and maybe I just shorted 20 with 19 while testing.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #9 on: Tue, 04 February 2014, 07:19:55 »
All the chips should be on the back; no need to take it apart :)

Except for the capacitive sense chip, the chips are standard - you can get the datasheets and know which pins are worth testing for continuity to the connector (i.e. the controlling pins rather than the inputs and outputs).

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #10 on: Tue, 04 February 2014, 08:08:58 »
I'm halfway. I've traced all pins from 20 to 10. They go to LV07A and LVC138A.

Now the other half, they seem to go toward the TP1684. I'll post the diagram when they are all traced (and pictures), hoping in your continued support :)

Offline CPTBadAss

  • Woke up like this
  • Posts: 14363
    • Tactile Zine
Re: Help me reverse-eng a capacitive FC660C
« Reply #11 on: Tue, 04 February 2014, 08:11:48 »
I came to read this thread, believing matt was going to reverse engineer the Topre switch for use elsewhere. That wasn't the case, but I kept reading to try and understand what was posted.  Looking forward to learning more about circuitry though this project :D.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #12 on: Tue, 04 February 2014, 08:19:27 »
I came to read this thread, believing matt was going to reverse engineer the Topre switch for use elsewhere. That wasn't the case, but I kept reading to try and understand what was posted.  Looking forward to learning more about circuitry though this project :D.

oh I already have the slider prototypes in production for that

Offline CPTBadAss

  • Woke up like this
  • Posts: 14363
    • Tactile Zine
Re: Help me reverse-eng a capacitive FC660C
« Reply #13 on: Tue, 04 February 2014, 08:27:22 »
You're amazing matt3o :D. Can you link me to that info? Or is it not in a thread somewhere?

Offline CPTBadAss

  • Woke up like this
  • Posts: 14363
    • Tactile Zine
Re: Help me reverse-eng a capacitive FC660C
« Reply #14 on: Tue, 04 February 2014, 08:27:26 »
You're amazing matt3o :D. Can you link me to that info? Or is it not in a thread somewhere?

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #15 on: Tue, 04 February 2014, 08:30:38 »
You're amazing matt3o :D. Can you link me to that info? Or is it not in a thread somewhere?

waiting for the prototypes to come to my place.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #16 on: Wed, 05 February 2014, 00:53:01 »
I'm halfway. I've traced all pins from 20 to 10. They go to LV07A and LVC138A.

Now the other half, they seem to go toward the TP1684. I'll post the diagram when they are all traced (and pictures), hoping in your continued support :)


first two chips are buffer and mux. why they're monolithic i'm not sure, but i do know the topre guys are very... set in their ways.

i want to say the tp1684 is a current output monolithic amp but i can't find the part number anywhere. what's the pinout and form factor?

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #17 on: Wed, 05 February 2014, 02:34:57 »
The story so far... please note that the pins on the main header are numbered in reverse order (ie: the way they are numbered on the daughter board)



I'm not sure the NC are really NC... they seem to go to some header labelled CPx and from there nowhere. I'll double check. I believe I still miss a couple of traces.

This is the high res PCB


@ming the TP1684 is on the bottom, to the right of the connector

I have a feeling that the PCB is multi-layered because some switches have no visible traces reaching them...
« Last Edit: Wed, 05 February 2014, 04:26:53 by Matt3o »

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #18 on: Wed, 05 February 2014, 14:00:20 »
so hasu says the tp1684 is an OEM only capacitive sensor. i'm going to take a wild guess that it has either 8 or 4 channels. everything else on there is either a mux or the ad5258 digipot which is almost certainly to tune the gain in the capacitive sense controller. the cap-sense controller outputs keypresses according to hasu, so i'm actually curious why a 20 pin cable is needed to go to the renaeses on the daughterboard.. also why are some of the muxes sent along with the TP output? i think a log analyzer is needed for the TP and a scope on some of the mux pins that exit on cable..

maybe they couldn't decide whether they were going to cap sense on the MCU (more app cores now have like 8 cap sense lines..) or on board so they passed on both..

can you trace the first 10 pins and see if they actually go anywhere on the daughterboard?

i can guarantee you that the board is 4-layer by the way.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline hasu

  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Help me reverse-eng a capacitive FC660C
« Reply #19 on: Wed, 05 February 2014, 15:46:05 »
I think TP1684 has only one chanel but not completely sure due to no datasheet available.
Only one channel is used in HHKB at least and I think it is same in FC660C.

https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hhkb/doc/HHKB.txt

LV4051: http://www.nxp.com/documents/data_sheet/74LV4051.pdf
LV138: http://www.nxp.com/documents/data_sheet/74LV138.pdf
LV07: http://www.ti.com/lit/ds/sces337j/sces337j.pdf

Looks like from the pic;
- FC660C uses LVC138 to drive line(column) and two 4051 to select sense line(row).
- Its matrix size can be 8col x 16row at maximum.
- LVC138 uses 4lines from connector for ~E1,A0, A1, A2.
- LV4051 uses 4lines from connector for ~E, S0, S1, S2. In sum 8lines for two chips.
- 2 lines used for LED dirve.(FC660C has two LED, right?)
- LV07 buffers are used to drive two LEDs and 8 columns.
- TP1684 uses 2 lines for KEY and KEY_PREV.(not sure from the pic, just guess from HHKB)

I guess 4+8+2+2=16 lines are used like above. Other lines may be power lines.


Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #20 on: Wed, 05 February 2014, 16:35:31 »
so the MCU controls the muxes then grabs digital output from the 1684? that is silly and weird. i guess it makes some sense.. they don't want to bring the analog lines off board -- too much noise etc. but then why not just put the MCU on the same board as everything else? that cap sensor is bigger than most 8-bit MCUs :\

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #21 on: Wed, 05 February 2014, 17:23:13 »
if you guys talked Turkish I would have probably understand you better. Anyway I'll try to trace all the missing tracks... and all the matrix. It's a hell of a job, but tomorrow I'll try to sort it out.

btw, yes, 660c has 2 leds

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #22 on: Wed, 05 February 2014, 19:07:39 »
turkish? please, hasu's preferred language is japanese ;)

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #23 on: Wed, 05 February 2014, 19:52:36 »
Same set of chips on the Realforce 103, except BU9831 instead of AD5258. And all on one PCB.

Anyway, keep tracing! But don't bother tracing the matrix, do that with software :D

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #24 on: Wed, 05 February 2014, 20:00:31 »
at 4-layers, i suspect they could have fit the MCU on the board. but who knows. it may be a simple issue where they're tied to renaesas (NEC, iirc) for the MCU due to their firmware build, and ren. just doesn't have any MCUs with cap sense on them yet.

i do know that freescale has a line of 16-bit power-based MCUs that could do most of what that chipset is doing on a single die, and that all the new phone and tablet targeted socs have cap-sense on them in a tqfn or bga package. i find it hard to believe that that entire chipset costs less than any volume MCU made after 2010.

ESPECIALLY when you have to build out a daughterboard to fit the whole thing in the chassis :\

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #25 on: Wed, 05 February 2014, 20:33:43 »
Erm, they are 2-layer PCBs.

I dunno when Topre first designed 'em, but I doubt the design has changed much since then. Inertia.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #26 on: Wed, 05 February 2014, 20:56:04 »
oh really? that's quite interesting :O

afaik all the realforce boards are 4-layer.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #27 on: Wed, 05 February 2014, 21:08:14 »
I meant all of them - certainly the Realforce 103 I have here, that FC660C looks 2-layer, and the HHKB, IIRC. Why would they need/want more? Plenty of ground plane there already, and deliberately not underneath the switches.

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #28 on: Wed, 05 February 2014, 21:32:13 »
there are way too many vias on that board. either the designers felt the need to drill through to ground every 3mm or there are more than two layers there.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline hasu

  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Help me reverse-eng a capacitive FC660C
« Reply #29 on: Wed, 05 February 2014, 22:26:52 »
I'm almost sure PCB of HHKB pro has more than two layers, it may be a 4-layer.
If it is 2-layer I can't explain how its traces goes. I don't know about Realforce I have never looked into its PCB closely.

But Topre doen't use necessarily multi-layer PCB to build a their capacitive switch. They made it even with one-sided board! :D

EDIT: This is Sun short type keyboard. Green molded one is old bigger TP1683 :D


I like this PCB design, it is beautiful IMO.
« Last Edit: Wed, 05 February 2014, 22:47:08 by hasu »

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #30 on: Thu, 06 February 2014, 00:45:11 »
hah, it looks great until you get to the gigantic rats nest at the top ;)

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #31 on: Thu, 06 February 2014, 01:54:03 »
there's no way this has just 2 layers (unless I'm missing something really obvious).

There are keys with absolutely no visible tracks going to them (both sides). Even the daughter board seems to be multi-layered.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #32 on: Thu, 06 February 2014, 02:48:00 »
All pins connected. Don't ask me what to do with this because I have no clue :)

I'll also try to understand how the controllers are connected to each other


Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #33 on: Fri, 07 February 2014, 08:50:39 »
ok, this thing seems way over my head. I'm a little scared of frying the keyboard while doing some tests with custom firmware. It's too different from the HHKB for me to try to mess with Hasu's code.

I'll just swap the 45g with 55g for now.
« Last Edit: Fri, 07 February 2014, 09:05:42 by Matt3o »

Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #34 on: Fri, 07 February 2014, 10:37:10 »
the LV ICs are all multiplexers to reduce the number of matrix lines needed. the MCU scans a big segment of the matrix at a time. the ad528 is a digipot that is probably used to trim an amp somewhere.

the TP1684 is a capacitive sensor. modern MCUs include an array of capacitive sensors for multi-touch screens, cap touch buttons, etc. apparently topre is stuck in the early 90s with an NEC MCU (i bet the code on that thing hasn't changed in 10 years.. oy vey) and a separate discrete capacitive sensor.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #35 on: Fri, 07 February 2014, 10:39:13 »
Oh, you wimp :P As long as the power connections and the output from the TP1684 are correct, there's very little chance of doing any damage. Hasu's code would need some modding, but perhaps not a huge amount. Agreed though, that doing this kind of thing I would be using my 'scope / logic analyzer to verify what I was doing, at least at the early stages.
« Last Edit: Fri, 07 February 2014, 10:40:55 by Soarer »

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #36 on: Fri, 07 February 2014, 10:53:11 »
I'll do one last test with the keyboard actually powered before throwing the towel.

Offline vivalarevoluci鏮

  • Posts: 2146
  • Location: Naptown, Indiana, USA
  • Keep it real b/c any other way is too stressful
Re: Help me reverse-eng a capacitive FC660C
« Reply #37 on: Fri, 07 February 2014, 19:30:13 »
If you guys could translate this discussion into English, that would be great.
Wish I had some gif or quote for this space, but I got nothing

Offline hasu

  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Help me reverse-eng a capacitive FC660C
« Reply #38 on: Fri, 07 February 2014, 20:40:11 »
Learn Turkish :)

Connector line 1 and 2 each drive LEDs via LV07(Z7) buffer clearly.
3,4,5 and 6 control rows with LVC138 and it seems to drive lines through 5 buffers of LV07(Z1). So the matrix has only 5 rows, not 8?

I guess 7,8 and 9 lines select columns to sense with two LV4051 via LV07(Z7). If I'm correct 2,4,6 of LV07(Z7) will be connected with 9,10,11 of two LV4051 in parallel to select column input from matrix.
Namely you can select 16 column lines with signals 7,8,9,10 and 11 from daughter board.

I don't know why they need to control AD5258 from controller. Need to read datasheet and know how to use that chip. HHKB has no control of its potentiometer.
Except for potentiometer it looks like you can control with same method as HHKB.



Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #39 on: Fri, 07 February 2014, 21:14:52 »
hasu, i assume the digipot is tuning an amp somewhere (i could swear i saw one in there..). the HHKBs may have been stable enough that the trimpot could just be set at the factory, but the new manufacturing line does not have time for that and so they use a dc servo of some kind.

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #40 on: Sat, 08 February 2014, 01:59:35 »
Learn Turkish :)

Connector line 1 and 2 each drive LEDs via LV07(Z7) buffer clearly.
3,4,5 and 6 control rows with LVC138 and it seems to drive lines through 5 buffers of LV07(Z1). So the matrix has only 5 rows, not 8?

I guess 7,8 and 9 lines select columns to sense with two LV4051 via LV07(Z7). If I'm correct 2,4,6 of LV07(Z7) will be connected with 9,10,11 of two LV4051 in parallel to select column input from matrix.
Namely you can select 16 column lines with signals 7,8,9,10 and 11 from daughter board.

I don't know why they need to control AD5258 from controller. Need to read datasheet and know how to use that chip. HHKB has no control of its potentiometer.
Except for potentiometer it looks like you can control with same method as HHKB.

thanks you Hasu, you are my own personal superhero.

AD5258 datasheet says
1 W W Terminal, GND ≤ VW ≤ VDD.
2 ADO Programmable Three-State Address Bit 0 for Multiple Package Decoding. State is registered on
power-up.
3 AD1 Programmable Three-State Address Bit 1 for Multiple Package Decoding. State is registered on
power-up.
4 SDA Serial Data Input/Output.
5 SCL Serial Clock Input. Positive edge triggered.
6 VLOGIC Logic Power Supply.
7 GND Digital Ground.
8 VDD Positive Power Supply.
9 B B Terminal, GND ≤ VB ≤ VDD.
10 A A Terminal, GND ≤ VA ≤ VDD.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #41 on: Sat, 08 February 2014, 09:17:38 »
If I'm correct 2,4,6 of LV07(Z7) will be connected with 9,10,11 of two LV4051 in parallel to select column input from matrix.

yes, I checked and this is the case. I don't know how you did it...

I don't know why they need to control AD5258 from controller. Need to read datasheet and know how to use that chip. HHKB has no control of its potentiometer.
Except for potentiometer it looks like you can control with same method as HHKB.

no clue what to do with those two pins.

I tried to burn a modified version of the firmware with changes based on my schema and Hasu's instructions but it is not working. I'll double check everything from scratch...

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #42 on: Sat, 08 February 2014, 10:12:31 »
That's a pain... those pins are I2C aka TWI, and I guess that chip will need at least some default settings uploaded to it before the rest will work correctly (at least a reasonable assumption). It gets a bit involved trying to work out what to send, and how to set up hasu's code to send it (although he does have an I2C library in there already, I think, for the ergodox). The ideal thing would be to monitor what the existing controller is sending to it - with something like a logic analyzer or a Bus Pirate (or possibly a Teensy).

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #43 on: Sat, 08 February 2014, 11:26:18 »
I forgot to say that I made some more tests with the keyboard actually connected.

pin 16 is +5
pin 17 is +3 (so it has to be regulated before sending it to the main PCB)
18 and 19 are ground, not connected to the ground on pin 20

couldn't the AD5258 simply send the value from the capacitive sensor on pin 4? Arduino has integrated I2C protocol I could try to connect one and see what is read


Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #44 on: Sat, 08 February 2014, 17:43:56 »
That's a pain... those pins are I2C aka TWI, and I guess that chip will need at least some default settings uploaded to it before the rest will work correctly (at least a reasonable assumption). It gets a bit involved trying to work out what to send, and how to set up hasu's code to send it (although he does have an I2C library in there already, I think, for the ergodox). The ideal thing would be to monitor what the existing controller is sending to it - with something like a logic analyzer or a Bus Pirate (or possibly a Teensy).
agreed. someone needs to take a bus pirate and/or open logic analyzer to it.


to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Matt3o

  • -[起財-
  • ** Robot Emeritus
  • Thread Starter
  • Posts: 3547
  • Location: Italy
Re: Help me reverse-eng a capacitive FC660C
« Reply #45 on: Sun, 09 February 2014, 02:17:57 »
at least I tried... :P

Offline hasu

  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Help me reverse-eng a capacitive FC660C
« Reply #46 on: Sun, 09 February 2014, 15:29:50 »
hasu, i assume the digipot is tuning an amp somewhere (i could swear i saw one in there..). the HHKBs may have been stable enough that the trimpot could just be set at the factory, but the new manufacturing line does not have time for that and so they use a dc servo of some kind.

That's a pain... those pins are I2C aka TWI, and I guess that chip will need at least some default settings uploaded to it before the rest will work correctly (at least a reasonable assumption). It gets a bit involved trying to work out what to send, and how to set up hasu's code to send it (although he does have an I2C library in there already, I think, for the ergodox). The ideal thing would be to monitor what the existing controller is sending to it - with something like a logic analyzer or a Bus Pirate (or possibly a Teensy).

That's a pain... those pins are I2C aka TWI, and I guess that chip will need at least some default settings uploaded to it before the rest will work correctly (at least a reasonable assumption).
Yes. It is really reasonable. HHKB has digipot Rohm BU9831 with "Auto recall function" which it loads resistance value from EEPROM *automatically* on every power up. HHKB doesn't need to control its digipot at all during its operation.
http://pdf1.alldatasheet.com/datasheet-pdf/view/36387/ROHM/BU9831.html
But the digipot of FC660C doesn't seem to have this function so you will have to send a RESTORE command to restore value from EEPROM at startup.


hasu, i assume the digipot is tuning an amp somewhere (i could swear i saw one in there..).
I guess  so. Topre probably calibrates its sensitivity or actuation point with digipot at their factory. And I can recall they exhibited ugly modded Realforce with volume(VR) to tweak actuation point :D



Offline mkawa

  •  No Marketplace Access
  • Posts: 6562
  • (ツ)@@@. crankypants
Re: Help me reverse-eng a capacitive FC660C
« Reply #47 on: Sun, 09 February 2014, 16:25:24 »
that's hilarious. "no no, turn that knob until it works, it's fine!"

hah

to all the brilliant friends who have left us, and all the students who climb on their shoulders.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Help me reverse-eng a capacitive FC660C
« Reply #48 on: Sun, 09 February 2014, 16:45:01 »
Hmm, IF all it takes is to send it a RESTORE command, then that's not too bad.

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Help me reverse-eng a capacitive FC660C
« Reply #49 on: Tue, 11 February 2014, 00:44:43 »
I forgot to say that I made some more tests with the keyboard actually connected.

pin 16 is +5
pin 17 is +3 (so it has to be regulated before sending it to the main PCB)
18 and 19 are ground, not connected to the ground on pin 20

couldn't the AD5258 simply send the value from the capacitive sensor on pin 4? Arduino has integrated I2C protocol I could try to connect one and see what is read

Show Image


Oh haven;t checked up on this for a while, or I'd have said as soon as I saw the PCB picture.

Pin 20 goes to the mounting point which is (rightfully) isolated from the gnd plane of the KB. So pin20 goes to case gnd and pin 19 and 18 go to the PCB gnd.

I guess they have to play around with grounding a lot more with these capacitive designs.

I wish a real engineer would come and corrent me if I'm wrong though. I'm still very much a learner when it comes to electronics.