CommonSense: matrix LCR meter with a HID interface

User avatar
Techno Trousers
100,000,000 actuations

20 Apr 2018, 04:28

I can smell what you guys are cooking, and it's nice and savory!

User avatar
DMA

20 Apr 2018, 04:58

wcass wrote: What layout would you like to see? 104, SSK, or something else?
I don't know yet.

The idea was to use this as a "brains" module with larger "controller PCB" which have sense card interface.
That larger PCB may also have footprint for BLE module + power/battery management circuitry, or just be a breakout board with USB connector and fuse on it (different form-factors using the same module to alleviate current displaywriter controller deficit. Want a displaywriter controller? Order the breakout board on oshpark, solder the brains in and you're done)

..also I need to submit this to PCBA shop and ask them if it's even suitable for PCBA :) Parts may be too close to each other.

User avatar
DMA

22 Apr 2018, 04:45

TIL four-sided castellated modules are not a thing.
Also that smallest candidate for PCBA is 50x100mm - which means paneling.
And that it looks like castellations can only be done on non-panelized PCBs.

Back to the drawing board, it seems.

__red__

22 Apr 2018, 10:29

DMA wrote: TIL four-sided castellated modules are not a thing.
Sure they are: https://getchip.com/pages/chippro
Also that smallest candidate for PCBA is 50x100mm - which means paneling.
And that it looks like castellations can only be done on non-panelized PCBs.

Back to the drawing board, it seems.
... you just have to have enough of an edge for V-score between castellations.

User avatar
DMA

22 Apr 2018, 20:27

__red__ wrote: ... you just have to have enough of an edge for V-score between castellations.
Submitted to PCBWay w/o panelization. Let's see what happens.

User avatar
DMA

24 Apr 2018, 08:20

TIL those 18x14 "brain" modules will be $10.61@100 units plus shipping (PCBway). [IC] time?

User avatar
FletchINKy

25 Apr 2018, 16:49

DMA, has the github code been adjusted to the board you're designing, or will it still run on a CY8CKIT-059? I have a custom 4x12 PCB I'd like to use this on.

User avatar
DMA

26 Apr 2018, 03:43

FletchINKy nope, the github code is for the kit. Currently it's for 8x12 matrix (XTant).
Most probably it will always be the kit (unless I forget and commit the custom version)
Even if it wasn't - switching to the kit is 3 clicks (explained in readme, too).

User avatar
DMA

07 May 2018, 02:25

CommonSense now supports different scanners - namely, ADB and Sun protocols.
So one can make 2 keyboard controllers from one protokit - KitProg can be used as a converter (or for keypad - one can still do 5x5-ish matrix from KitProg :)

User avatar
idollar
i$

25 May 2018, 12:23

I am trying to understand if the is a group buy or similar way to get a PCB ......
Can anyone help ?

User avatar
Wodan
ISO Advocate

25 May 2018, 14:11

idollar wrote: I am trying to understand if the is a group buy or similar way to get a PCB ......
Can anyone help ?
This is about a firmware/software. The controller used is a VERY affordable developer kit:
http://www.cypress.com/part/cy8c5888lti-lp097

No more Xwhatsit Controller GBs, instead just 12$ controllers from various distributors :)

User avatar
DMA

26 May 2018, 01:21

idollar I actually think of making the PCBs - but the kit makes custom PCB much harder to justify.

It's $10 - http://www.cypress.com/documentation/de ... rammer-and - and you can make 2 controllers from it.

Wodan's link is for much more expensive one :)

User avatar
Techno Trousers
100,000,000 actuations

26 May 2018, 02:17

So you snap the $10 one in half and get a large micro USB and small USB-A connected controllers?

User avatar
DMA

26 May 2018, 02:45

Techno Trousers: yep. I use mine as USB-Sun and USB-ADB controllers. But it also can be used as keypad controller, for example. The problem is it has much less GPIOs available.

User avatar
DMA

05 Jun 2018, 04:23

Oh, I can actually program and configure controllers for anyone who asks. Just ship the kit to me (I can tell you the address in PM) and tell me what configuration you want to have. And, unless you live in europe and shipping is exorbitant, I'll send you the pre-programmed, pre-configured kit, ready to solder.
This way you won't even need the windows machine - all you'll have to do is configure sensitivity and configure layout.
PS: I'll keep the kitprog - unless you specifically need it for something (in which case you'd be better off doing whole configuration yourself :) )

User avatar
Sangdrax

26 Jul 2018, 02:54

I had a quick question. I need to use the expansion header for both a Capslock LED and a Beeper. Flightcontroller only seems to let you pick one or the other. Is there a way to do both? Also, the expansion header pins go high right? So LED's connect one end to pin and one to ground?

Also, anything special about what you can assign as header pins? Or is it all just whatever is free, not a voltage reference and rated for 25mA? And are functions slaved to assigned pin? Like is Caps always a certain one and so on?

User avatar
DMA

26 Jul 2018, 03:51

Sangdrax wrote: I had a quick question. I need to use the expansion header for both a Capslock LED and a Beeper.
Not supported. LEDs (all 3) or solenoid. Not "fundamentally unsupported" - just "not supported". If you convince me it's a good idea - I'll do it.
Now solenoid + lock switch configuration is not supported fundamentally. I don't want to muck with host's lock state. I can be convinced it's cool - but that will take a lot of convincing because it's host's business and what if you have 2 keyboards, one with such a switch set to "on" and another to "off"? Constant ping-ponging?
Sangdrax wrote: expansion header pins go high right? So LED's connect one end to pin and one to ground?
Yep.
Sangdrax wrote: Also, anything special about what you can assign as header pins? Or is it all just whatever is free, not a voltage reference and rated for 25mA?
Pretty much. Cypress doesn't mind to put 20mA LEDs on protokit and connecting them to "4mA source, 8mA sink" pins though. So probably any pin is fine.
Sangdrax wrote: And are functions slaved to assigned pin? Like is Caps always a certain one and so on?
Yes, and this is defined in exp.h
num-caps-scroll IIRC.
Solenoid has "enabled" and "active" pins to maintain compatibility with xwhatsit solenoid driver board.

User avatar
Sangdrax

27 Jul 2018, 03:31

This keyboard just needs the LED, doesn't have an actual locking switch. Way that worked on the xwhatsit was I think you got one assignable LED and the solenoid but you couldn't use the neat little ribbon cable because it was all in the same header. But that was just a free pin limitation I think. In this project, I think I can get away with just the LED since the piezo beeper is a non-original addition from the original owner. But it would be cool to fire it up if I could.

I had one more question. Is there a way to get more aggressive debouncing than 16? I'm having the same problem I had with the xwhatsit on these same kind of keytronic switches. Occasional double presses on a handful of keys even when everything is set to correct threshold. I had to flash the alternative debounce on that one to fix it, which IIRC mostly just slowed the scan rate.

Otherwise, everything is working great. Learning curve is a bit steeper on your stuff, but the fine control really is superior in every way that matters. And you can't beat the price or size.

Image

User avatar
DMA

27 Jul 2018, 05:04

xwhatsit - at least 0.9 version - has solenoid, LEDs, and solenoid + lock switch (for normally open and normally closed variants). That's all there is in the GUI. Not a big problem to add buzzer + 2 LEDs (Num+Caps - no one ever needs ScrLk nowadays) - I have 4 pins in exp header after all. Doable over the weekend, needs like 10 minutes really.

Wait, did I make debouncing to 16? Must be some special request, never needed more than 4, actually.
If you have double presses - just lower the threshold. Don't be afraid going down to max(15s) + 1. Debouncing algo requires X _consecutive_ readouts to flip the state - this is hard to reach accidentally.
Although if you have linear switches - there may be a problem of key not flying fast enough towards PCB, and sensor (3k+ scans per second, remember?) having time to count those 7 ones then 7 zeroes than 7 ones again. In which case just increase the second delay to, dunno, 2000? This will lower scanning frequency, effectively extending debounce window.

Want to hear about learning curve, actually. What was hard?

User avatar
Sangdrax

27 Jul 2018, 06:17

Mostly just the little stuff that comes with looking at any new program, and this was two. And there's a couple minor things left out of the GITHub tutorial I was following that might trip someone unfamiliar or not paying attention.

The main zip download includes the Bluetooth, separate firmware for the kit programmer for if you remove it and make it into it's own thing and also that new Sun conversion thing you were woking on. The kit programmer firmware pops up first in the PSoC Creator main screen when you open the main Capsense project. Took me a few seconds of wondering why the diagram had too few pins before I realized what I was really seeing. Some mention of removing extraneous modules before compiling would have saved some time. Especially since the Bluetooth expansion wouldn't compile on mine (program referenced needing to download additional components) and the Sun scanner file was missing from the folders.

FlightController is a neat program, but a couple basic explanations of functions would be nice. Maybe they're already there and I just missed it. Main ones that would have helped.

The board automatically shuts off the scan module with all keys firing at once. So you have to set thresholds to something just to start. But even if you do, you have to reinitialize it or it still won't do anything. Took me a bit to figure out you click Scan and Output to do that. I thought the lower bar was just status stuff at first.

Upload temporarily uploads settings to flash for testing. Confirm writes those settings to the chip EEPROM.

Setup mode makes it where no keypresses register outside the program. But you can turn this off for concurrent testing fine tuning stuff like doublepressing keys or ghosting.

You can't upload with key monitor running. And if you accidentally try, you have to close out the program and unplug and replug the USB to restart the devboard. Reset button probably works too but I didn't have access to it in the case when doing this.

Also, cranking up the discharge time really worked well like you said. Still going to be fiddling with a few settings but it's all smooth sailing now. I bumped it from .25milisec to .9milisec. 2 caused some kind of rollover error in FlightController and worked but bogged down a bit, so I kept cranking it down to find a sweet spot.

User avatar
DMA

28 Jul 2018, 20:35

Rejoice! I changed "Solenoid" mode to "Solenoid + Num + Caps". FlightController doesn't need to be changed, just the firmware. There's a separate commit for firmware, if you want to cherrypick (you probably do).

Most of the other stuff is fixed too. Inline.
Sangdrax wrote: The main zip download includes the Bluetooth, separate firmware for the kit programmer for if you remove it and make it into it's own thing and also that new Sun conversion thing you were woking on. The kit programmer firmware pops up first in the PSoC Creator main screen when you open the main Capsense project. Took me a few seconds of wondering why the diagram had too few pins before I realized what I was really seeing. Some mention of removing extraneous modules before compiling would have saved some time. Especially since the Bluetooth expansion wouldn't compile on mine (program referenced needing to download additional components) and the Sun scanner file was missing from the folders.
Fixed. README.md is updated not to advise to build everything.
Also those sun scanner files are added. I just forgot to add them..
Sangdrax wrote: FlightController is a neat program, but a couple basic explanations of functions would be nice. Maybe they're already there and I just missed it. Main ones that would have helped.
I must add documentation. But there's some catch-22 situation - hard to convince oneself to write documentation for no users.
Sangdrax wrote: The board automatically shuts off the scan module with all keys firing at once. So you have to set thresholds to something just to start. But even if you do, you have to reinitialize it or it still won't do anything.
Actually, every time you upload config the controller reevaluates safety of the scanning module and automatically enables it if safe to do so. This feature was added after several cases of keyboard spamming the system after settings update.
Sangdrax wrote: I thought the lower bar was just status stuff at first.
They were just the status LEDs at first. But then I thought..
Sangdrax wrote: Upload temporarily uploads settings to flash for testing. Confirm writes those settings to the chip EEPROM.
Explanation added to menu items.
Sangdrax wrote: Setup mode makes it where no keypresses register outside the program. But you can turn this off for concurrent testing fine tuning stuff like doublepressing keys or ghosting.
Actually setup mode logs all keypresses - so you can see double keypresses in the main FlightController window.
Sangdrax wrote: You can't upload with key monitor running. And if you accidentally try, you have to close out the program and unplug and replug the USB to restart the devboard. Reset button probably works too but I didn't have access to it in the case when doing this.
Fixed - it's not possible to upload config with monitor running :)
It is still possible to get into "Not a good day to upload config" state - the fix is to click "Reconnect" button to reset internal state.
Sangdrax wrote: Also, cranking up the discharge time really worked well like you said. Still going to be fiddling with a few settings but it's all smooth sailing now.
Yay!
Sangdrax wrote: 2 caused some kind of rollover error in FlightController and worked but bogged down a bit, so I kept cranking it down to find a sweet spot.
What do you mean by "bogged down a bit"? those delays are in hardware, no waiting from software side, when delay expires it fires an interrupt. So apart from slower scanning nothing should happen..
Just tried 65000 as discharge delay. It works (though the reaction is slow - which is expected. 65000 is about 3 milliseconds, so one matrix scan is 25ms. Even with modest 4-step debouncing that's 10Hz scanrate)

User avatar
Sangdrax

28 Jul 2018, 22:34

Awesome. Will break out the soldering station and report back in a bit on having the new features hooked up.

What I meant by bogging down was the letters would show when I was typing, but there would be a full quarter to half second delay. That was in notepad, not the concurrent log in Flightcontroller which seemed to show up immediately. So could have just been something on the PC itself. Not sure what was up with that, but it went away when I turned the delay down a bit.

User avatar
Sangdrax

30 Jul 2018, 05:00

Well, I got the new firmware loaded and everything wired up using the header pins specified in the new config. I used a solenoid board I had soldered awhile back that I know tested good.

Everything builds fine.

The current Bootloader folder is missing the compiled hex for the other stuff to reference when it builds. I still had it from the last version so just moving the folder over worked.

The one thing I can't hunt down is the independent FlightController.exe. Can't even find where I got the old one now and I just downloaded it the other day. So I can't turn the new features in the header on and test it all out. The old version still has the normal 3.

User avatar
DMA

30 Jul 2018, 06:25

Sangdrax wrote: The current Bootloader folder is missing the compiled hex for the other stuff to reference when it builds.
That's kind of the point. Bootloader project builds the bootloader (elf+hex). Then firmware uses that bootloader.
Sangdrax wrote: The one thing I can't hunt down is the independent FlightController.exe. Can't even find where I got the old one now and I just downloaded it the other day. So I can't turn the new features in the header on and test it all out. The old version still has the normal 3.
https://github.com/dmaone/CommonSense/r ... tag/v0.2.1

User avatar
Sangdrax

30 Jul 2018, 06:51

DMA wrote:
Sangdrax wrote: The current Bootloader folder is missing the compiled hex for the other stuff to reference when it builds.
That's kind of the point. Bootloader project builds the bootloader (elf+hex). Then firmware uses that bootloader.
Wait, I figured out how I was being retarded. I was just building (test compiling) instead of actually building firmware. :lol:


Thanks a ton for the updated .exe. I should have everything running shortly. This is going to be exciting!

User avatar
Sangdrax

30 Jul 2018, 08:51

Success! This battlestation is fully armed and operational. I'm definitely using your setup for every capacitive project from here on out. Wonderful work.

Image

Would have been impossible with any other option with how little space there was to work with in this board.

Image


Typing tests.

Without header.
https://www.dropbox.com/s/2y5z8diwo210d ... t.mp4?dl=0

With Capslock AND Beeper via solenoid board.
https://www.dropbox.com/s/pryyjz9365sj2 ... r.mp4?dl=0

User avatar
DMA

30 Jul 2018, 16:40

You can break away the kitprog - you'll never need it anymore.

User avatar
Sangdrax

30 Jul 2018, 23:03

Yeah, just wanted to wait until I was completely done in case I borked a firmware update in Flightcontroller and needed to hook up to PSoC Creator again (got an unreadable node error first time I tried when I accidentally unplugged the board before it was finished :lol: ).

I bet I can use it in something else fun down the road. Honestly, I think the best use would be compatibility with something like Hasu's convertor since everyone can always use extra convertors. His seems mostly based around Atmel stuff though I have no idea how tough that is.

Image

User avatar
wcass

31 Jul 2018, 04:10

Could the kitprog be used for a smaller capacitive keyboard? Something like 4x5 plus maybe one LED?

User avatar
DMA

31 Jul 2018, 06:37

wcass wrote: Could the kitprog be used for a smaller capacitive keyboard? Something like 4x5 plus maybe one LED?
Sure, why not. Kitprog's 5868 is more than capable for that.
Also 5868 can be desoldered from the kitprog and reused on custom PCB :)

Sangdrax actually it's very easy to make a converter from the kitprog. Open the KitProgConverter project and see for yourself. sun_scanner.c + UART in the design should be enough for every serial-protocol-using keyboard (except those working with 12V - for those level-shifter will be needed). And there's not many not-serial-using keyboards.

PS: Got myself a topre board for the experiments. Just need to run it thru a dishwasher, because https://www.instagram.com/p/Bl3T_YTg-O1/

Post Reply

Return to “Workshop”