Unexpected GPIO behaviour; reading 0 where 1 expected

Discussion to talk about hardware related topics only.
Post Reply
ScottM
Posts: 32
Joined: Mon Feb 01, 2010 10:00 am

Unexpected GPIO behaviour; reading 0 where 1 expected

Post 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.
ScottM
Posts: 32
Joined: Mon Feb 01, 2010 10:00 am

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Post 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...
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Post by Ridgeglider »

seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Post 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
ecasey
Posts: 164
Joined: Sat Mar 26, 2011 9:34 pm

Re: Unexpected GPIO behaviour; reading 0 where 1 expected

Post 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
Post Reply