Voltage level of gpio input

fesc

Member
Hi,
i'm using Teensy for my handwired keyboard projects, running qmk firmware.

For the first one i built i used Tennsy++ 2.0, since i need lots of gpios. The keyboard matrix is 24 columns x 6 rows, basically 24 GPIO inputs which get pulled low (to the row gpio via a diode) when a key in the corresponding column is pressed. So basically a standard keyboard matrix.

Now i had the problem that one of the column GPIOs was not pulled to the proper level of 3.3V but something in between (with no key pressed), so that all keys in that column were randomly triggered. I though that this device was broken, added an extern pullup and everything works fine.

Now i built a 2nd kb, and as the 2.0 is no longer easily available i used (a completely overdimensioned) Teensy 4.1. And what do i see? Exactly the same issue. One GPIO behaving just the same, when i measure it has 2V instead of 3.3, which is interpreted as random key press. All other 23 work fine up to now.

So i wonder, am i doing something wrong? Am i overstressing the devices somehow? Do i generally need external pullups? The current it draws is about 80mA.
Or maybe a known QMK configuration issue (didn't ask there yet ..).

Thanks for any hint ..
 
Has the hardware been adapted for Teensy 4.1? The size and pinout is quite different between Teensy++ 2.0 and Teensy 4.1. If you just plug a Teensy 4.1 into a PCB that's designed for Teensy++ 2.0, you can expect problems since some of the pins which were power become I/O and vise versa.
 
Hi,
i'm using Teensy for my handwired keyboard projects, running qmk firmware.

For the first one i built i used Tennsy++ 2.0, since i need lots of gpios. The keyboard matrix is 24 columns x 6 rows, basically 24 GPIO inputs which get pulled low (to the row gpio via a diode) when a key in the corresponding column is pressed. So basically a standard keyboard matrix.

Now i had the problem that one of the column GPIOs was not pulled to the proper level of 3.3V but something in between (with no key pressed), so that all keys in that column were randomly triggered. I though that this device was broken, added an extern pullup and everything works fine.

Now i built a 2nd kb, and as the 2.0 is no longer easily available i used (a completely overdimensioned) Teensy 4.1. And what do i see? Exactly the same issue. One GPIO behaving just the same, when i measure it has 2V instead of 3.3, which is interpreted as random key press. All other 23 work fine up to now.

So i wonder, am i doing something wrong? Am i overstressing the devices somehow? Do i generally need external pullups? The current it draws is about 80mA.
Or maybe a known QMK configuration issue (didn't ask there yet ..).

Thanks for any hint ..
To me that seems like a problem with your wiring

Try to disconnect the teensy completely from the circuit and measure the output voltage when that column is pressed. If its not pulled to 3.3v then its a circuit problem. Test the other columns too.
 
Has the hardware been adapted for Teensy 4.1?
Yes, and it's actually working. Except this one gpio.

To me that seems like a problem with your wiring
I will try it next on the T4.1. But back when the same issue occurred on on the T++2.0 it was not a circuit problem ..

What i forgot to mentioned was that in both cases this issue wasn't there initially, only after some days of use. As if the internal pullup somehow broke.
 
Is it outputting 2 only at the pin or is it outputting 2v at the start of the column matrix. At 2v I would assume something is floating
 
The internal pullup seems broken (pin 38). Even disconnected from the circuit it hangs at 2V. I wired the column to a different GPIO and it works. Those things seem to be really fragile.
(But i will replace it with a teensy++ 2.0, a keyboard taking 10 seconds to boot is not really usable.)
 
Last edited:
I'm confused. How will replacing with Teensy++ 2.0 (assuming you still have one, they're discontinued) actually help? Didn't you say in msg #4 "the same issue occurred on on the T++2.0 it was not a circuit problem".

Also confused about "a keyboard taking 10 seconds to boot is not really usable". No Teensy takes anywhere near that time to boot. All are well under under 0.5 second. Most of that boot time is an intentional 0.3 second delay which you can override using the startup hooks.
 
Well, i hope it won't happen on the Teensy 2 again. Then i would be really confused .. i mean, it's a vanilla keyboard matrix, although quite big.
The reason i am switching are various issues with qmk for T4.1, like the boot time, some lacking features (like keyboard console not working), the whole build environment seems no so well maintained. But those i need to address with qmk.

.. and just before i write this .. another GPIO seems gone :-( It really looks like there is a hard limit of 23 rows this thing tolerates. Or my sample is simply broken.
 
Last edited:
Do these work by driving each row gpio output low sequentially and checking all the column inputs to see if any of them are pulled low?.

If so what voltage are the column inputs pulled up to?

What value of pull up resister are you putting on them?

I ask because I think when i was reading the specs on the teensies last I decided on max load of 3mA.

Gavin.
 
From what i see, the pullup is configured to 47K, alternatives are 100 or 22. Yes, row is set low one by one, columns values are checked for keypress.

qmk_firmware/lib/chibios-contrib/os/hal/ports/MIMXRT1062/LLD/GPIOv1/hal_pal_lld.c:
C:
IOMUXC->SW_PAD_CTL_PAD[SW_PAD_CTL_PAD_by_index[pad]] =
      IOMUXC_SW_PAD_CTL_PAD_PKE(1) | /* Pull/Keep Enable */
      IOMUXC_SW_PAD_CTL_PAD_PUS(1) | /* Pull Up/Down Config: 47k pull up */
      IOMUXC_SW_PAD_CTL_PAD_PUE(1); /* Pull/Keep Select: pull */
 
I would have thought there would need to be a drive strength value assigned there to actually drive the pull-up.

All the row GPIOs definitely have diodes feeding into them? Otherwise pressing multiple keys might short two rows together, connecting a HIGH output directly to GND.
 
Last edited:
Back
Top