Dave,
Did you switch banks for each time you changed from in to out.
Gordon
----- Original Message -----
From: Dave & Ann Scott <spam_OUTandscottTakeThisOuT
LOGANTELE.COM>
To: <.....PICLISTKILLspam
@spam@MITVMA.MIT.EDU>
Sent: Friday, August 13, 1999 12:37 PM
Subject: False HI on Pin, Trying to use pin for both input & output
> I'm trying to use one I/O for both input and output (RA1 on a 16C84).
>
> Software - Every 8sec or so the pin is changed to an output and set high
to
{Quote hidden}> drive an LED for about 200msec....then turned off and changed back to an
> input. Between the LED blinks I poll the input to check whether it's HI.
> To debounce, the input must be HI once and again 20msec later. I've got
> the weak pull-ups disabled.
>
> 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
{Quote hidden}> pulled out of the circuit and circuit left open (so pushbutton is not
> malfunctioning).
>
> I added a 1s delay between turning off the LED and reading the input and
> problem still occurs. (90% sure the delay is working properly.)
>
> If I ground the pin, the error does not occur (and LED does not blink).
>
> There is a 20msec delay between turning off the LED and reading the pin.
> Between LED blinks, the pin is read every 20 msec. It appears that a LED
> blink is not necessary to make the error occur.
>
> It's intermittent. :) At other times the other routine functions
> correctly when the pushbutton is pressed.
>
> If relevant, I'm working on a breadboard.
>
> Can anyone tell me I'm doing wrong? I suspect it's something simple but I
> haven't been able to figure it out.
>
> Dave Scott