I have a Cheapino that I recently built according to Tompi's guide, and it works great for single keypresses and all pairs of keys I have tried, but certain trios of keys cause a 4th key to be activated even though not physically pressed. I used 1N4148 axial through-hole diodes as indicated by the BoM and the build guide. The ghosting on the left side occurs regardless of whether I have the right side connected via 8p8c keyed connector.
#Diagnosing 3->4 Key Ghosting on Cheapino Charlieplex
1 messages · Page 1 of 1 (latest)
The first trio that I noticed ghosting was, all on the left hand: middle thumb, bottom pinky, and middle-row middle, that is LH1 + LB4 + LM2. The ghost key is bottom-row middle: LB2. There is NOT any ghosting if I press LH1 + LB4 + LB2
Others that ghost with the LH1 + LB4 starting pattern; "A ghosts to B" means I physically pressed A and B gets activated unwittingly:
- LM2 ghosts to LB2
- LB1 ghosts to LM1
- LM0 ghosts to LB0
- LB3 ghosts to LM3
So, the pattern there seems to be that the false activation is one key higher or lower, spatially, and the direction alternates.
It also happens starting with the LB4 + LM2 pair: pressing LB3 with those two activates LM4 (so in QWERTY terms, ZDX -> A
With 123 on the thumb keys left to right
QWD: A
QWC: Z
QW1: X
QW2: S
QRG: A
QRB: Z
QR1: V
QR2: F
Seems like any given pair has exactly 4 other keys with which ghosting occurs 🤔
Pretty sure there is no chance for ghosting across halves, since their diode-ness is isolated from each other.
Some pairs have no ghosting at all: for example, QT plus any other key on the left hand is just fine.
Safe pairs in caps, semi-ghosty pairs in lowercase:
qw, QE, qr, QT
QA, QS, qd, QF, qg
QZ, QX, qc, QV, qb
q1, q2, Q3
If I flip the thumb keys to where they are electrically, I think it is more like:
Q3 -- qw QE qr QT
q2 QA QS qd QF qg
q1 QZ QX qc QV qb
simplified to, with Q held, X for bad and . for safe
.-X.X.
X..X.X
X..X.X
I really gotta diagram out one of the ghost situations to see what the relevant parts of the circuit look like.
If I am reading the datasheet right, the forward V for a 1N4148 diode should be in the 0.5V to 0.7V range when in the 0.1mA to 1mA range that I expect the board is experiencing. https://www.digikey.com/htmldatasheets/production/1227458/0/0/1/1n4148.html?utm_adgroup=Semiconductor Modules&&utm_adgroup=Semiconductor Modules&utm_source=google&utm_medium=cpc&utm_campaign=Dynamic Search_EN_Product&utm_term=&utm_content=Semiconductor Modules&utm_id=go_cmp-120565755_adg-7526266035_ad-398870538204_dsa-43336454289_dev-c_ext-_prd-_sig-Cj0KCQiAq-u9BhCjARIsANLj-s1zWh948vTjaij72kLd2srp7RG23RplN_CCJvHCfJ0srQ0EnWe_mvwaAtYNEALw_wcB&gad_source=1&gclid=Cj0KCQiAq-u9BhCjARIsANLj-s1zWh948vTjaij72kLd2srp7RG23RplN_CCJvHCfJ0srQ0EnWe_mvwaAtYNEALw_wcB&gclsrc=aw.ds
View datasheets for 1N4148 by Vishay Semiconductor Diodes Division and other related components here.
The controller is a RP2040 on a WaveShare RP2040 Zero board. My expectation is that the RP2040 will consider anything above about 1.8V to be "high" (but maybe that is an ill-informed expectation?)
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#voltage-specifications says it might be more like 2.0V
at any rate, I am guessing it might start being in ambiguous territory in the 1.0V to 2.0V range (very roughly)
Here is my stab at diagramming it in KiCad
Ok, so it looks like there is a path from D28 through K8, K10, and K13 to D26 that passes through 3 diodes. So maybe those three diodes are not enough to drop the voltage below the RP2040's "detect high" threshold?
3.3V - 0.5 - 0.5 - 0.5 = 3.3 - 1.5 = 1.8
(if these diodes only have a forward drop of 0.5V at 100 microamps)
If instead they are dropping it more like 700mV then it should be 3.3 - 2.1 = 1.2 ... still kinda in the "dunno" zone, but not as close to the "definitely high" range
Aha! It is a known issue in the Cheapino: https://github.com/tompi/cheapino/issues/33
Sounds like tompi was able to fix it in QMK/Vial; I wonder whether it would be easy to do the same in ZMK
Ah, looks like he fixed it by rejecting certain keypresses when their well-known ghosting cause combos were also pressed.
Could probably fix it in hardware by doubling some of the diodes
I will see if I can add them on the back side or something. I would want one per GPIO pin in use, right?
no, you'd want them on the troblesome switches