Strange GPIO voltages
Posted: Sun Jan 05, 2020 11:23 am
Hi all,
I have been doing some tests on the GPIOs to see how the various settings affect them. The tests use 3 pins
- 32 set to GPIO_MODE_INPUT and GPIO_PULLUP_ONLY
- 35 set to GPIO_MODE_INPUT and GPIO_FLOATING (input only pin with no pull up/ down circuitry)
- 33 set to GPIO_MODE_INPUT and GPIO_FLOATING
I then run the following tests on each pin looking at a digital read on the pin (the H and L in the table) and the voltage across the resistor
1. 100k resistor between gnd and pin
2. 100k resistor between +3.3v and pin
3. 10k resistor between gnd and pin
4. 10k resistor between +3.3v and pin
The results were not as I had expected so have a few questions
1. pin 32 to gnd tests. Calculating the value of the internal pullup (assuming a voltage divider) gives 25k and 35k respectively. So assume it is not as easy as that?
2. pin 32 for the pull up tests, not sure why I get such a small voltage. Since it is set to internal pullup would have assumed close to 3.3v?
3. pin 35 looks ok to me is this as I should expect it?
4. pin 33 the digital reads are fine but don't understand why I get 0 / low voltages. I would have expected it to behave like pin 35?
Any help appreciated.
thanks
Lee.
I have been doing some tests on the GPIOs to see how the various settings affect them. The tests use 3 pins
- 32 set to GPIO_MODE_INPUT and GPIO_PULLUP_ONLY
- 35 set to GPIO_MODE_INPUT and GPIO_FLOATING (input only pin with no pull up/ down circuitry)
- 33 set to GPIO_MODE_INPUT and GPIO_FLOATING
I then run the following tests on each pin looking at a digital read on the pin (the H and L in the table) and the voltage across the resistor
1. 100k resistor between gnd and pin
2. 100k resistor between +3.3v and pin
3. 10k resistor between gnd and pin
4. 10k resistor between +3.3v and pin
Code: Select all
Pin Gnd via 100k +3.3v via 100k Gnd via 10k +3.3v via 10k
32 H (2.723v) H (1.2mV) L (0.755v) H (0.3mV)
35 L (1.429v) H (0.826v) L (0.356v) H (0.206v)
33 L (0.2mV) H (0.1mV) L (0v) H (0v)
1. pin 32 to gnd tests. Calculating the value of the internal pullup (assuming a voltage divider) gives 25k and 35k respectively. So assume it is not as easy as that?
2. pin 32 for the pull up tests, not sure why I get such a small voltage. Since it is set to internal pullup would have assumed close to 3.3v?
3. pin 35 looks ok to me is this as I should expect it?
4. pin 33 the digital reads are fine but don't understand why I get 0 / low voltages. I would have expected it to behave like pin 35?
Any help appreciated.
thanks
Lee.