Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
samuelkadolph
Posts: 8
Joined: 31 Oct 2017 07:21

Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by samuelkadolph »

I'm trying to use pins 5,6,7,8 with the builtin pullup resistor and I discovered that pin 5 is still floating despite the mode being INPUT_PULLUP. Is this a known limitation? I checked all the other pins and they were all working properly. It just seems like pin 5 it doesn't work on. I've tried on the two z-unos that I have.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by PoltoS »

This was fixed recently and will become part of next release. This is because of UART/USB. After they are initialized, change it again to pull-up and it should work then
samuelkadolph
Posts: 8
Joined: 31 Oct 2017 07:21

Re: Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by samuelkadolph »

Is there a workaround for the current release? I tried having pinMode after Serial.begin() but it still had the same issue.
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by p0lyg0n1 »

The workaround is to initialize it after the first loop(in the second loop).
For example try this:

Code: Select all

byte loop_cnt = 0;
void loop()
{
    if(loop_cnt < 2)
    {
       if(loop_cnt == 1)
       {
          // ...
          pinMode(5, INPUT_PULLUP);
          // ...
       }
       loop_cnt++;
    }
}
schmidmi
Posts: 55
Joined: 01 Dec 2016 16:45
Location: Germany (Karlsruhe)

Re: Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by schmidmi »

This problem is not only at pin 5. I had the same problem at pin 18. But the workaround works :)
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Pin 5 in INPUT_PULLUP mode isn't pulled HIGH

Post by PoltoS »

It is on all pins sharing the same port (8 pins)
Post Reply