Interface circuit with external tactile switches using the 40-pin header

Hi there,
we are trying to interface external tactile switches on to to the 40-pins header of the Jetson Xavier AGX platform using GPIO input handling. However PU or PD configuration does detect a rising or falling edge but only once and it seems that the external circuits is not triggering correctly.
Do you have a sample circuit/code on how to connect external tactile switches ?
Best regards,
Xavier.

hello xavier,

please download Xavier Developer Kit Carrier Board Specification, and please refer to Chapter-3.3 for 40-Pin Expansion Header.
you may also refer to documentation for Configuring the 40-Pin Expansion Header with Jetson‑IO.
thanks

hello Jerry,
thanks for your reply, we had move forward with the circuit below on 6 GPIO of the 40-pin header in pull-up mode w/ a 1k pull-up and a 0.1uF debounce capacitor. However when using the debounce capacitors on all 6 GPIOs circuits, after 2 switches of the tact switches, the system reboots. Without the debounce capacitors, it does not reboot but we may have bounces on the tact switches (For reference we are using ALPS SKPMBHE010 and SKPFAAA010 for tact switches), Best. Xavier.

Hello Jerry,
concerning this issue, we also tested without the debouncing capacitor and we still observe random bounces on the release.
Please find attached a scope probe from the GPIO signal on release when the code detects a rise/fall instead of rise only.
Do you have a reference design circuit for external tact switch connected on gpios ? Best. Xavier

Dear Jerry,
did you get my last messages regarding a reference design to connect tactile switches on Jetson Xavier GPIO on the 40-pin header. Regards, Xavier.

There are some notes on the GPIOs of 40 pin header as there is a Bi-direction level shift between pins and Xavier chip. Please check the Application Note (same one on nano and Xavier) for the detail request.

Also you can search TXB0108 datasheet online, it has requests on drive strength, PU/PD value and should not be used in applications such as I2C or 1-Wire where an open-drain driver is
connected on the bidirectional data I/O.

This is an important point! The level shifter on the GPIO means that the pull up / down settings on the GPIO pins don’t make it all the way out to the actual header you can hook up to.

The TXB0108 is somewhat jittery. It doesn’t like too large, nor too small pull-ups or pull-downs. In my experience, a 47 kOhm pull-up resistor is more appropriate than 1 kOhm, and you’ll want to NOT configure the pins for pull-up / pull-down on the Jetson. Trying to drive the pins from the Jetson will confuse the translator. 0.1 uF is appropriate for a 47 kOhm pull-up resistor (will give you about 5 millisecond debounce.)

@snarky, thanks a lot for your reply and this clarification on the Xavier SoC to external 40-pin header through the TXB0108 level-shifter. I made some tests :

  • “GPIO.setup(pin, GPIO.IN)” (no “pull_up_down” settings) + 47k pull-up :the “GPIO.add_event” does not trigger rise/fall events
  • If adding a 0.1uF on the tact switch : it does not trigger neither
  • If PU=1k (no 0.1uF) (either “GPIO.setup(pin, GPIO.IN)” or “GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)”), the add_event triggers the rise/fall edges
    Do you think I am missing something as I do understand your explanation on the TXB0108 architecture.
    Best. Xavier.

It may be that 47 kOhm is too weak. I think 1k is too strong, but if it works for you, it’s not strictly bad.
You should be able to use 1k+0.1uF, or perhaps 4.7k+0.1uF, with that setup.
The main thing to realize is that a pull-up on the Jetson side will confuse the TXB level translator, so instead use an external pull-up or pull-down.

@snarky I will make some tests with some values between 1k and 47k and feedback you. For memo I am using 2 different tact switches from ALPS and the behaviour is not the same (their R[initial_contact] is not the same though) .With 1k One is correctly working w/o bounce and the other has some bounce every once a while. Which GPIO setting are you using in your code to prevent jetson side to confuse the TXB level translator ? Regards, Xavier.

I don’t turn on pullup or pulldown; I just read them as plain inputs, and I use weaker outside pullups.
I haven’t seen that level of contact bounce as you suggest – that sounds terrible! I’m using ESwitch switches, but I’m also not particularly sensitive to bounce, because all my code has software-level hold-off after trigger.
I also generally like having a separate resistor between the pin and the switch, which helps settle things down if something goes wrong (a short or whatever.)
IIRC, I used 10 kOhm pull-up, 1 kOhm pin-to-switch, and no capacitor, and it worked well enough for me. Again, with software de-bounce.