piclist 2001\01\01\004502a >
Thread: Picky I/O
www.piclist.com/techref/microchip/ios.htm?key=i%2Fo
flavicon
face BY : Roman Black email (remove spam text)



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

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu


<3A5018B2.2E17@ezy.net.au> 7bit

See also: www.piclist.com/techref/microchip/ios.htm?key=i%2Fo

Reply You must be a member of the piclist mailing 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

month overview.

new search...