David VanHorn wrote:
>
> I just reconfirmed the low state, adding some "pings" on an unused pin.
> It's definitely low, at 10mV, when that btfsc is executed.
>
> If I enable that routine, we wait forever, even though the pin is an input,
> and low.
> It's as if something's getting between the code, and the external pin.

David when you initialse the port for direction, you are
following the PROPER sequence by issuing a

clrf PORTB

before your
bsf STATUS,RP0
bsf TRISB,x
stuff??

I have been caught by this before. Also it is a good idea to
use a softare delay of a half second or so defore doing any
pin sensing to allow voltages to stabilise, and my preference
is to set all pins as outs and drive them low, then 0.5 sec
delay, then change pins to inputs again and start running.

You never know if a capacitive load on a pin will cause
it to play up during initialisation especially if VSS is
not up to scratch yet. :o)
-Roman

ReplyYou must be a member of the
piclistmailing list
(not only a www.piclist.com member) to post to the
piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change)
Picky I/O