> Van: Dave & Ann Scott > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: False HI on Pin, Trying to use pin for both input & output > Datum: vrijdag 13 augustus 1999 19:37 > > I'm trying to use one I/O for both input and output (RA1 on a 16C84). > Hardware - The pin has a 470 ohm resistor and (Smurf-) blue LED to ground. > Also a pushbutton switch and 10k resistor to V+. > > What should happen: > If pushbutton not pressed - LED should just blink every 8 sec. > If pushbutton is pressed - start other routine. > > What does happen: Other routine starts by itself. Even if 10k resistor is > pulled out of the circuit and circuit left open (so pushbutton is not > malfunctioning). Hello Dave, You are testing the the I/O while the LED is Off. This means that the I/O line is floating (or rather High, due to the Chip-design). Reason ? Think of a LED as a Zener-diode. If it's ON, current flows. If it's OFF allmost _NO_ current flows (leakage only !), so it can't be used as a pull-down. Solution : Put a resistor parallel to the LED. How come I know this ? Simple: I stepped in the same pit-fall you did :-) Greetz, Rudy Wieser