Page 1 of 1

Unexpected GPIO behaviour; reading 0 where 1 expected

Posted: Tue Apr 17, 2012 5:58 pm
by ScottM
I configured thusly:
J2[9].function(PINJ2_PD_GPIO);
J2[9].hiz();
and used J2[9].read() to examine it.

With pin 9 unconnected, I see 0.
When connected to J2 pin 2 (+3v3) through a 680 ohm resistor, no problem - I see a logic 1.
But when I use a 10k resistor, I get 0.

That sort of buggers my plan to attach an RC network to the pin and measure the time until I see a 1, as a way of determining resistance. The resistance I wanted to measure gets up to 100K or so. Is there a strong pulldown on these pins? Can I turn it off?

Barring that, is there a better way to measure resistances (between about 1k to 120K) with a pin? TIA.

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Posted: Wed Apr 25, 2012 5:40 am
by ScottM
C'mon, folk. Someone here must have detailed knowledge of how these GPIO pins work. I've never used a processor where you had to drag a pin high this hard, to get it to register a logic 1, which makes me think I've done something wrong...

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Posted: Wed Apr 25, 2012 5:45 am
by Ridgeglider

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Posted: Wed Apr 25, 2012 6:16 am
by seulater
what module are you using?, This this thread where i wrote an app to help with this.

http://forum.embeddedethernet.com/viewt ... 4771#p4771

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Posted: Wed Apr 25, 2012 4:30 pm
by ecasey
Scott,

I think this might be related to the 1k pulldown on pin J2[9] on the DEV 70 board, if that is what you are using.

Ed