Jump to content
Sign in to follow this  
JulianR

GPIO pullups/pulldowns not working

Recommended Posts

I am using the Tinkerboard 2 and wiringPi. The pullup/pulldown seems not to work for all pins. For example here I use pin 5 (pyhsical 18) and set it to pulldown. But As you can see below the value is still 1. The weird thing is that if I pull the pin up/down by connecting it for a short time to 3,3V/GND the pin always stays at the value that I connected it to no matter what pull mode I set.

Here the terminal commands/output:

gpio mode 5 input

gpio mode 5 down

gpio readall
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |  73 |   8 | GPIO2B1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |
 |  74 |   9 | GPIO2B2 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   8 |   7 | CLKOUT2 |  CLK | 0 |  7 || 8  | 1 | IN   | GPIO2C1 | 15  | 81  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | GPIO2C0 | 16  | 80  |
 |  83 |   0 | GPIO2C3 |   IN | 1 | 11 || 12 | 0 | IN   | GPIO3D0 | 1   | 120 |
 |  85 |   2 | GPIO2C5 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  84 |   3 | GPIO2C4 |   IN | 0 | 15 || 16 | 1 | OUT  | GPIO2C6 | 4   | 86  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | IN   | GPIO2C7 | 5   | 87  |
 |  40 |  12 |  MOSI.1 |  SPI | 0 | 19 || 20 |   |      | 0v      |     |     |
 |  39 |  13 |  MISO.1 |  SPI | 1 | 21 || 22 | 0 | IN   | GPIO3D4 | 6   | 124 |
 |  41 |  14 |  SCLK.1 |  SPI | 1 | 23 || 24 | 1 | OUT  | GPIO1B2 | 10  | 42  |
 |     |     |      0v |      |   | 25 || 26 | 0 | IN   | GPIO0A6 | 11  | 6   |
 |  71 |  30 | GPIO2A7 |   IN | 1 | 27 || 28 | 1 | IN   | GPIO2B0 | 31  | 72  |
 | 126 |  21 | GPIO3D6 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
 | 125 |  22 | GPIO3D5 |  OUT | 1 | 31 || 32 | 0 | IN   | GPIO4C2 | 26  | 146 |
 | 150 |  23 | GPIO4C6 |  OUT | 1 | 33 || 34 |   |      | 0v      |     |     |
 | 121 |  24 | GPIO3D1 |   IN | 0 | 35 || 36 | 1 | IN   | GPIO2C2 | 27  | 82  |
 | 149 |  25 | GPIO4C5 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO3D3 | 28  | 123 |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO3D7 | 29  | 127 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+

 

Share this post


Link to post
Share on other sites

Hi @JulianR:

     Which version image do you use?  If you don't config by gpio tools and just read by gpio readall command, could you get the right status by link the pin to 3.3v or GND?

Thank a lot!

 

Share this post


Link to post
Share on other sites

Hi, sorry for the late answer, I was in vacation.

I am using the latest version (Tinker_Board_2-Debian-Buster-v2.0.4-20211222).

I get the right status if I just read and link the pin to 3.3v/GND. Also it always stays to the latest connected voltage when reading after disconnecting.

Share this post


Link to post
Share on other sites

Hi @JulianR

When pin 5 (pyhsical 18) set as an input port, to avoid leaving the connector in a floating or unknown state when the wires are not connected. This pin will maintain the latest connection voltage, which is a hardware behavior.
If you want to be able to restore the original state, it is recommended to add external pull-up (3.3K) or pull-down (100K) resistors to do the default state setting.

Thanks.

Share this post


Link to post
Share on other sites

Hi.

I have same problem. 

Also, I wonder why these CPU pin number are different from the number that official announced. 

e.g.) The physical pin 11 is equal to CPU pin 164 in official site, but my computer says it's pin 83.
Actually, it can be used as pin 83.

https://www.asus.com/us/Networking-IoT-Servers/AIoT-Industrial-Solutions/Tinker-Board-Series/Tinker-Board/#:~:text=get install git-,GPIO pinout,-If you would

Here is the result of `gpio readall`

+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |  73 |   8 |   SDA.6 |  I2C | 1 |  3 || 4  |   |      | 5v      |     |     |
 |  74 |   9 |   SCL.6 |  I2C | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   8 |   7 | GPIO0B0 |   IN | 1 |  7 || 8  | 1 | SERL | TxD.0   | 15  | 81  |
 |     |     |      0v |      |   |  9 || 10 | 1 | SERL | RxD.0   | 16  | 80  |
 |  83 |   0 |  RTSN.0 | SERL | 1 | 11 || 12 | 0 | IN   | GPIO3D0 | 1   | 120 |
 |  85 |   2 |  MOSI.5 |  SPI | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  84 |   3 |  MISO.5 |  SPI | 0 | 15 || 16 | 0 | SPI  | SCLK.5      | 4   | 86  |
 |     |     |    3.3v |      |   | 17 || 18 | 1 | SPI  | CE5.0      | 5   | 87  |
 |  40 |  12 |  MOSI.1 |  SPI | 0 | 19 || 20 |   |      | 0v      |     |     |
 |  39 |  13 |  MISO.1 |  SPI | 1 | 21 || 22 | 0 | IN   | GPIO3D4 | 6   | 124 |
 |  41 |  14 |  SCLK.1 |  SPI | 1 | 23 || 24 | 1 | SPI  | CE1.0   | 10  | 42  |
 |     |     |      0v |      |   | 25 || 26 | 0 | IN   | GPIO0A6 | 11  | 6   |
 |  71 |  30 |    SDA.7 |  I2C | 1 | 27 || 28 | 1 | I2C  | SCL.7    | 31  | 72  |
 | 126 |  21 | GPIO3D6 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
 | 125 |  22 | GPIO3D5 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO4C2 | 26  | 146 |
 | 150 |  23 | GPIO4C6 |   IN | 1 | 33 || 34 |   |      | 0v      |     |     |
 | 121 |  24 | GPIO3D1 |   IN | 1 | 35 || 36 | 1 | SERL | CTSN.0   | 27  | 82  |
 | 149 |  25 | GPIO4C5 |   IN | 1 | 37 || 38 | 0 | IN   | GPIO3D3 | 28  | 123 |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO3D7 | 29  | 127 |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
 +-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+

 

I am not sure if these differences are related to the main issue, but I offer this as information.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...