[Done] CommonSense controller - better capsense!

HuBandiT wrote:Are you also experiencing EMI while not scanning?

Dunno, I'm constantly scanning :) Except in USB suspend, but even there I scan about 10 times per second.
DMA

Unread post14 Dec 2017, 02:22

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
DMA wrote:I'll check if it's possible to run cypress stuff using VirtualBox when I have time

This is how I run it.
__red__

Unread post15 Dec 2017, 04:33

X
__red__
 
Posts: 435
Joined: 14 May 2012, 20:12
Location: Beamspringville
Main keyboard: 4704
DT Pro Member: 0186
 
Hi, I've wired the PSoC to the XT at long last. But the signals are very faint on the matrix monitor. Some of the rows look quite dead, stuck at zero. Others appear to be sensing some low-level noise. Only one column registers a few key presses, and even so, these don't go high, about 6 or 7.

The PCB was suspect to start with, quite a few areas of the board have black copper oxide under the solder resist layer. It could be that some traces are corroded to the point it is no longer conducting electricity at all. I must do a continuity check.

I have a second XT which looks in good shape, no corrosion, but I don't have a way to test it first before modifying it, to check it's a known-good specimen,

DMA, __red__, please can you help me with suggestions how to debug the hardware? Even a list of basic things to check first is useful, such as continuity checks etc., I may have missed something very obvious. It would be useful information to share.
solder-PSoC-pcb.jpeg
wire connections to the PSoC

solder-XT-pcb.jpeg
wire connections to the XT keyboard logic board

Connecting-wires.jpeg
Wire looms between keyboard logic pcb and the PSoC pcb
tigpha

Unread post23 Dec 2017, 21:49

X
tigpha
 
Posts: 261
Joined: 04 May 2015, 20:54
Location: United Kingdom
Main keyboard: IBM Bigfoot + Arduino
Main mouse: Kensington Orbit Trackball
Favorite switch: IBM Model F buckling spring
DT Pro Member: -
 
When I said "I tested it with 2 ft wires and it worked" I didn't mean it to be a recommendation. It should work though.
You don't have a scope, I presume?

obvious things:
1) check that you don't use pins with capacitors. They're marked * on the picture with kit pin descriptions.
2) check there's no shorts. Between PCB and the metal cage, too.

Once this is taken care of -
open the assembly, get access to the PCB. Leave the PCB on the back plate. run matrix monitor. Grasp the row wire you see responses from, press your other hands' finger against contact plates on the PCB, observe. You should see pretty strong signal.
If that doesn't work - touch column wires with the same fingers you used in previous step. Don't short row to column - you won't fry anything but the results may surprise you as I only read lower 8 bits from the ADC and god only knows what you'll see.
Or you may swap last 2 steps - or even desolder the controller from the board and just touch the pin pads to make sure the controller is OK.
DMA

Unread post24 Dec 2017, 00:21

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
 
The bringer of PSoC
DMA wrote:When I said "I tested it with 2 ft wires and it worked" I didn't mean it to be a recommendation. It should work though.
Hehehe :-) The wire looms are 20cm (8 inches) long. Since rewiring seems unavoidable, I'll trim much shorter.

As for a scope, I'd love to get one, but for the moment I'm experimenting to see how far a complete neophyte beginner (i.e. me!) can reach with very basic tools and understanding. A Rigol DSO is on my birthday presents wish list.
DMA wrote:obvious things:
1) check that you don't use pins with capacitors. They're marked * on the picture with kit pin descriptions.
2) check there's no shorts. Between PCB and the metal cage, too.

Point 1) Oops. I can already see I made a mistake. Does this rule apply to sensing lines on rows only, or in general just to be sure? I have to avoid P15_4 and P15_3 for the rows, and P15_2 for the columns.

This begs the question, how to remap the pins? RTFM no doubt, regarding PSoC Creator IDE, but a recipe how-to describing pin remapping would be a big help, please.

Point 2) Continuity and short probing is on my to-do list, definitely.
DMA wrote:Once this is taken care of -
open the assembly, get access to the PCB. Leave the PCB on the back plate. run matrix monitor. Grasp the row wire you see responses from, press your other hands' finger against contact plates on the PCB, observe. You should see pretty strong signal.
If that doesn't work - touch column wires with the same fingers you used in previous step. Don't short row to column - you won't fry anything but the results may surprise you as I only read lower 8 bits from the ADC and god only knows what you'll see.
Or you may swap last 2 steps - or even desolder the controller from the board and just touch the pin pads to make sure the controller is OK.

Thanks DMA, all this is very helpful advice. I deeply appreciate your time and patience.
tigpha

Unread post24 Dec 2017, 09:53

X
tigpha
 
Posts: 261
Joined: 04 May 2015, 20:54
Location: United Kingdom
Main keyboard: IBM Bigfoot + Arduino
Main mouse: Kensington Orbit Trackball
Favorite switch: IBM Model F buckling spring
DT Pro Member: -
 
tigpha wrote:A Rigol DSO is on my birthday presents wish list.

I don't know about DSO, but 4 channels are _very_ useful. 1 for trigger, 3 for signals. Although I probably used mine for like 40 hours now. Don't know if that's $400 well-spent. Allows to see things much better though.
tigpha wrote:Point 1) Oops. I can already see I made a mistake. Does this rule apply to sensing lines on rows only, or in general just to be sure? I have to avoid P15_4 and P15_3 for the rows, and P15_2 for the columns.

Actually, current github version has XT 8x12 matrix and pretty sensible pinout, guaranteed working (I'm using it on my daily driver). You can just reuse it.
tigpha wrote:This begs the question, how to remap the pins? RTFM no doubt, regarding PSoC Creator IDE, but a recipe how-to describing pin remapping would be a big help, please.

Look at "Pins" in the PSoC window with sources, near the top. the only trick there is that columns must be aligned to the bottom - "cols[23] is the last column in the matrix", not "cols[0] is the first column"
DMA

Unread post24 Dec 2017, 16:02

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
DMA wrote:I probably used mine for like 40 hours now. Don't know if that's $400 well-spent. Allows to see things much better though.
Better than not seeing at all, that's invaluable!
DMA wrote:current github version has XT 8x12 matrix and pretty sensible pinout, guaranteed working (I'm using it on my daily driver). You can just reuse it.
Big thanks! That's now Plan A. After continuity and shorts tests...
tigpha

Unread post24 Dec 2017, 19:25

X
tigpha
 
Posts: 261
Joined: 04 May 2015, 20:54
Location: United Kingdom
Main keyboard: IBM Bigfoot + Arduino
Main mouse: Kensington Orbit Trackball
Favorite switch: IBM Model F buckling spring
DT Pro Member: -
 
tigpha wrote:Big thanks! That's now Plan A. After continuity and shorts tests...

Just desolder the controller and grab one row and columns one by one.
You'll do two things by that:
a) verify mapping - you'll see which wire is which column IN REALTIME.
b) verify hardware isn't shot (though it shouldn't be, because you're getting SOME readings).
DMA

Unread post24 Dec 2017, 21:56

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
ADC resolution, charge and discharge delay, and debouncing buffer length are now configurable from FlightController.

In other news, fried 2 proto kits today by connecting to USB-C of a macbook pro connected to a power supply, using USB-C-to-female-USB-A which came with google pixel + the usual micro-USB cable.
Luckily I only connected my xtant when mac was on battery. For some reason this was safe.
Fried second one because oh well, that probably was static electricity first time. Suuuure.
DMA

Unread post21 Jan 2018, 01:28

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
 
The bringer of PSoC
That proto board has a fuse. I thought that was supposed to prevent permanent damage in an over-current situation.
wcass
User avatar

Unread post21 Jan 2018, 01:38

User avatar
X
wcass
 
Posts: 483
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
DT Pro Member: 0185
 
wcass wrote:That proto board has a fuse. I thought that was supposed to prevent permanent damage in an over-current situation.

Looks like this was an overvoltage situation :(
I don't know how much there was - could be 9, 12 or 20V. But I now have 2 dead kits on my hands.

OTOH those weren't the last ones - one in the xtant miraculously survived (because the macbook wasn't plugged in) and I have 2 more unused. It's just that feeling of "wtf, I killed 2 devices over some minor incompatibility!" and the fact I threw good money after bad.

Anyway. If I run out - I'll probably order couple of BT protoboards and make a BLUETOOTH MODEL F.
DMA

Unread post21 Jan 2018, 02:09

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
Hi guys. I'd like to test this controller as a replacement of the xwhatsit controller. Getting the CY8CKIT-059 controller is an easy thing but do you guys know which edge connector the xwhatsit uses to slip onto the pcb? I'd like to get such a part and then solder from this connector with wires onto the CY8CKIT-059 controller so that I don't damage/modify the pcb.
hansichen
User avatar

Unread post30 Jan 2018, 17:02

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
Its something like this https://www.ebay.co.uk/itm/Card-Edge-Co...SwUwFaQ3bU

but i don't know the exact spacing or number of pins sorry

If i can find my spare controller tonight i will have a look for you

I also that there was a BOM for his controller somewhere , take a look at that.

But honestly you can just solder it and remove it later if you need to , as long as you use plenty of flux and some solder wick you will get it clean at the end , will just take time.
andrewjoy

Unread post30 Jan 2018, 18:02

X
andrewjoy
 
Posts: 5099
Joined: 11 Apr 2012, 16:27
Location: UK
Main keyboard: Filco ZERO green alps, Model F 122 Terminal
Main mouse: Ducky Secret / Roller Mouse Pro 1
Favorite switch: MX Mount Topre / Model F Buckling
DT Pro Member: 0167
 
So, the unpopular position:

You can't buy the correct edge-connector. You can buy an edge-connector that is close - but there is no cigar.

The problem is that all modern edge-connectors are for standard width PCBs, the keyboard PCBs you're trying to interface to are much thinner.

Now, in every case that I know of, the pins on the top and bottom directly map so it still will _work_ from a connectivity standpoint, but it made me nervous enough from a reliability point of view that I directly soldered to the fingers.

I'll be posting something on the subject this evening I hope - just getting the photos set up.
__red__

Unread post30 Jan 2018, 22:30

X
__red__
 
Posts: 435
Joined: 14 May 2012, 20:12
Location: Beamspringville
Main keyboard: 4704
DT Pro Member: 0186
 
You could try pushing the pins down on the connector side , depending on how they are done ( like a cartridge slot on consoles etc) you should be able to tighten them up a bit
andrewjoy

Unread post30 Jan 2018, 22:35

X
andrewjoy
 
Posts: 5099
Joined: 11 Apr 2012, 16:27
Location: UK
Main keyboard: Filco ZERO green alps, Model F 122 Terminal
Main mouse: Ducky Secret / Roller Mouse Pro 1
Favorite switch: MX Mount Topre / Model F Buckling
DT Pro Member: 0167
 
hansichen wrote:Hi guys. I'd like to test this controller as a replacement of the xwhatsit controller. Getting the CY8CKIT-059 controller is an easy thing but do you guys know which edge connector the xwhatsit uses to slip onto the pcb? I'd like to get such a part and then solder from this connector with wires onto the CY8CKIT-059 controller so that I don't damage/modify the pcb.

What __red__ says. Solder it on.
The connector you're looking for is 2x30pin 3.96mm pin spacing. The problem is they all are made with 1.6mm-thick board in mind (or 1.8? can't remember exactly). And the board you have is 0.8mm thick.
DMA

Unread post31 Jan 2018, 03:04

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
Thanks guys, I think I'll look a bit more into the documentation before I decide to solder onto the pcb
hansichen
User avatar

Unread post31 Jan 2018, 15:26

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
Another idea that doesn't require soldering ... add a shim.

The original PCB is 0.8 mm and the connector wants 1.6 mm, so just add another 0.8 mm shim and stack it.

something like this:
Shim.png


You can get 3 of these from OshPark for $7.25 delivered. Select the option for "2 oz copper, 0.8mm thickness"
Gerber file is attached below.
Attachments
Shim.zip
(2.75 KiB) Downloaded 10 times
wcass
User avatar

Unread post31 Jan 2018, 21:49

User avatar
X
wcass
 
Posts: 483
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
DT Pro Member: 0185
 
wcass wrote:Another idea that doesn't require soldering ... add a shim.

The original PCB is 0.8 mm and the connector wants 1.6 mm, so just add another 0.8 mm shim and stack it.

something like this:
Shim.png


You can get 3 of these from OshPark for $7.25 delivered. Select the option for "2 oz copper, 0.8mm thickness"
Gerber file is attached below.

Oh, that's nice wcass - bravo!
__red__

Unread post31 Jan 2018, 22:40

X
__red__
 
Posts: 435
Joined: 14 May 2012, 20:12
Location: Beamspringville
Main keyboard: 4704
DT Pro Member: 0186
 
Thanks for your effort, after looking for all the parts I decided that I'll try the solder way. As long as I don't fuck it up it shouldn't matter that I soldered onto the pcb so I should be fine and I have a way easier time to source all the parts for it.
Is there a recommended pinout on which pin of the xwhatsit configuration to solder on which pin of the CY8CKIT-059 controller? From what I've seen there were only beamspring convertions with a custom pcb in this thread which didn't give any clue in that regard.
hansichen
User avatar

Unread post01 Feb 2018, 12:42

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
hansichen wrote:Thanks for your effort, after looking for all the parts I decided that I'll try the solder way. As long as I don't fuck it up it shouldn't matter that I soldered onto the pcb so I should be fine and I have a way easier time to source all the parts for it.
Is there a recommended pinout on which pin of the xwhatsit configuration to solder on which pin of the CY8CKIT-059 controller? From what I've seen there were only beamspring convertions with a custom pcb in this thread which didn't give any clue in that regard.

If you are using the CY8CKIT controller then that has nothing to do with xwhatsit at all. Completely different hardware, completely different software.

I actually owe a proper write-up to this forum, so give me a few and I'll try and get it knocked out.
__red__

Unread post01 Feb 2018, 18:24

X
__red__
 
Posts: 435
Joined: 14 May 2012, 20:12
Location: Beamspringville
Main keyboard: 4704
DT Pro Member: 0186
 
Ah sorry, I was asking about how to wire it up onto a normal beamspring pcb. On my pcb pins 2-6 are empty, 7-14 are columns, 15-16 empty, 17-25 columns, 27-30 rows. Pin 1 and 26 are connected which each other and they go around all of the pads, are these the grounding pins?

Code: Select all
Recommended pinout

    D0: P0[3]
    D1: P3[2]
    Rows: P0[0, 1, 5, 6, 7], P15[3, 4, 5]. Alternatively, P12 can be used to free more analog-capable pins, but watch for ExpHdr pins.
    Cols: P1[0-7], P2[0, 2-7], P3[0, 1, 3-7], P15[0, 1, 2].
    P0[2], P0[4] to +5V, P0[3], P3[2] to the ground.

Whew. Hopefully you're done with soldering now.


If I look at the pinout on the controller on github I understand the rows and columns, connecting P0[2] and P0[4] to +5V and P0[3 and P3[2] to ground on the controller is clear too. I still have problems to understand what D0 and D1 is for? Is this the ground connection of the pcb and plate? If so I should be connect either way pcb-pin 1 or 26 to one of them and the plate to the other one. Is that correct or did I understand something wrong?
hansichen
User avatar

Unread post02 Feb 2018, 18:18

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
No, D0 and D1 are internal references, not pins numbers. They're actually mapped in software to (off the top of my head) P0[3] and P3[2]
__red__

Unread post02 Feb 2018, 20:11

X
__red__
 
Posts: 435
Joined: 14 May 2012, 20:12
Location: Beamspringville
Main keyboard: 4704
DT Pro Member: 0186
 
wcass
User avatar

Unread post02 Feb 2018, 22:12

User avatar
X
wcass
 
Posts: 483
Joined: 27 Nov 2011, 21:18
Location: Fort Lauderdale, FL, USA
Main keyboard: ibm model m
Main mouse: kensington expert mouse
Favorite switch: buckeling spring
DT Pro Member: 0185
 
Thanks for your help, I feel like such a noob. I wired the whole thing now and build the bootloader. Now I try to do the firmware. I opened the file and changed it to beamspring and then went into the pinout. There I find all the columns and rows and D0, BootPin, \USB:Dp\, \USB:Dm\, \ADC0:ExtVref\ and skveral ExpHdr things to configure. D0 is clear, D1 is not existent here and for the others I kept the standard config for now. When compiling it I get two errors now, first #include "globals.h" in line 10 of cyaplcallbacks.h is not found, even if that file should exist normally.
At the moment I can't find a thing that I overlooked so I'm wondering what went wrong.
hansichen
User avatar

Unread post03 Feb 2018, 11:13

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
hansichen wrote:Thanks for your help, I feel like such a noob. I wired the whole thing now and build the bootloader. Now I try to do the firmware. I opened the file and changed it to beamspring and then went into the pinout. There I find all the columns and rows and D0, BootPin, \USB:Dp\, \USB:Dm\, \ADC0:ExtVref\ and skveral ExpHdr things to configure. D0 is clear, D1 is not existent here and for the others I kept the standard config for now. When compiling it I get two errors now, first #include "globals.h" in line 10 of cyaplcallbacks.h is not found, even if that file should exist normally.
At the moment I can't find a thing that I overlooked so I'm wondering what went wrong.

How do you change it to beamspring?
should be "#define SWITCH_TYPE BEAMSPRING".
Also check that MATRIX_COLS and MATRIX_ROWS match your intended configuration.
Those should be the only changes.

D1 doesn't exist indeed - added a note to README.md
In general you're not supposed to touch anything except rows and cols (and may be ExpHdr if you want solenoid. By default ExpHdr is configured to blink the kit's LED on keypress)
DMA

Unread post03 Feb 2018, 19:07

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
I went to /dma_core/globals.h in the PSoC Creator and changed #define SWITCH_TYPE BUCKLING SPRING to BEAMSPRING. If I see it correctly the board has 17 Columns and 4 Rows (This is the pcb printing: https://i.imgur.com/za0nt6X.png) and that's what I changed. After putting in the Rows and then building it with Ctrl + F5 I get this errors:
"prj-M0120: Build error: globals:h: No such file or directory" in file cyapicallbacks.h, line 10, col 21 and
"prj-M0120: Build error: The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
hansichen
User avatar

Unread post03 Feb 2018, 20:09

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
hansichen wrote:I went to /dma_core/globals.h in the PSoC Creator and changed #define SWITCH_TYPE BUCKLING SPRING to BEAMSPRING. If I see it correctly the board has 17 Columns and 4 Rows (This is the pcb printing: https://i.imgur.com/za0nt6X.png) and that's what I changed. After putting in the Rows and then building it with Ctrl + F5 I get this errors:
"prj-M0120: Build error: globals:h: No such file or directory" in file cyapicallbacks.h, line 10, col 21 and
"prj-M0120: Build error: The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.

Please do a git pull (or just download the zip again). I found a bug which will lock up the firmware if there's no configuration and fixed it.
I've tested the build - it compiles with SWITCH_TYPE BEAMSPRING, so everything should be good.

One thing to check - what is the path to CommonSense directory? Is it free from spaces and non-latin characters? Is it a local path (starts with a letter, that is - like C:\Projects\CommonSense) ?

Update: try to compile without changing any files. If that doesn't work - the problem is most likely paths. If that works.. try one change at a time. I never encountered this behavior before.
DMA

Unread post04 Feb 2018, 01:49

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
So I tested it several times today with several configs and the new and old zips. As a path I used C:\CommonSense\CommonSenseTest and I tried to compile everything without changing a thing. I still ended with the same Error codes as earlier.
hansichen
User avatar

Unread post04 Feb 2018, 15:38

User avatar
X
hansichen
 
Posts: 456
Joined: 21 Dec 2016, 16:25
Location: Cherry-country
Main keyboard: G80-2100
Main mouse: Deathadder
Favorite switch: Vintage Black
DT Pro Member: -
 
hansichen wrote:So I tested it several times today with several configs and the new and old zips. As a path I used C:\CommonSense\CommonSenseTest and I tried to compile everything without changing a thing. I still ended with the same Error codes as earlier.

Mind if we do a teamviewer session? Just don't send sessionid and password here, use the private message :)
DMA

Unread post04 Feb 2018, 16:19

X
DMA
 
Posts: 506
Joined: 23 May 2016, 06:24
Location: Seattle, US
Main keyboard: T420
Main mouse: Trackpoint
Favorite switch: beamspring
DT Pro Member: -
 
PreviousNext

Who is online

Users browsing this forum: Topdiff and 40 guests