I’ve wired a tactile push button switch to the Jetson Nano, active low with a 10 kohm resistor to +3.3 volts, connected to header pin number 33 (which is GPIO 13)
Installed Jetson.GPIO and wrote some python to use it. When I initialize the pin, I use GPIO.PUD_OFF.
The problem is, GPIO.input returns 1 when not pressed, when I press it just once and release it, GPIO.input returns 0, and then it will never return 1 ever again even though I release the button.
Then of course I troubleshoot with a multimeter, it measures 3.3V when released and 0V when pressed, the hardware appears to be fine.
The funny thing is, if I measure it with a multimeter, GPIO.input will start to return 1 again. So now, I’ve alligator-clipped my multimeter to the signal and now the entire script works as expected… I can get both 1s and 0s and the event callback fires as expected.
This seems to indicate that my 10 kohm resistor is too much resistance? Are there filtering capacitors or parasitic capacitances I am not aware of? Are there ESD protection diodes that’s messing with the signal? I can’t find DC electrical characteristics of the Jetson Nano’s GPIOs. Can somebody explain what’s wrong?
What is my best next move? Lower the resistor value to 4.7K? or maybe even 1K? Remove all resistors and depend solely on pull_up_down=GPIO.PUD_UP?
This explains everything. I forgot where but I also read how the SoC defaults to using internal pull-down resistors.
I also required my buttons to be active-high with pull-down resistors and now the entire script functions as it should.
So let this be a warning to all users, do NOT attempt to implement active-low buttons, only active-high works.
EDIT: Ok the situation has been explained below. It seems like MOST pins are defaulted to pull-down. The internal resistance can be very low so a 10 Kohm external resistor would be too high. My recommendation would be to check the chart to see if it is pull-up or pull-down, and implemented active-low for the pins that are pull-up and vice versa.
We are currently reviewing this to understand that issue, however, I do want to point out that different GPIOs on the 40-pin expansion header do have different pull-up/down configurations by default (ie. not all are pulled-down but maybe pulled-up) and that the internal pull strength does vary depending on the pins. So active-high may not work for all GPIOs by default.
If you refer to section ‘9.3 MPIO Pad Description’ of the Tegra X1 (SoC) Technical Reference Manual (available via the download centre), you will see that there are several different pad types, namely, ST, CZ, DD, LV_CZ, and others. Now the internal pulls vary by pad type …
ST --> 100k
CZ --> 18k
DD --> 100k
LV_CZ --> 15k
So to know the strength of the internal pull you need to first understand the pad type. The various tables in section 4 of the ‘Jetson Nano System-on-Module Data Sheet’ show the pad type for the different pins. For example, in section ‘4.7.2 Serial Peripheral Interface’ for the SPI pins you will see they are a mixture of CZ and LV_CZ. However, now you need to know the mapping of the pins to the 40-pin header.
To make things a bit easier here is a summary of the default pull configuration and strength for GPIOs on the Jetson Nano (which hopefully I have correct based upon reviewing the current settings):
It is possible to disable the pull completely or change the pull type from pull-up to pull-down or vice-versa, but to change this we need to generate a new default pin configuration for the Nano, which unfortunately at the moment is a bit of a convoluted process, but nonetheless we are working on putting the information together to allow users to change this.