piclist 2001\01\01\075541a >
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:
>
> Looking at this further, it appears that the setting and clearing bits in
> the TRIS register is not as simple as I thought.
>
> I had assumed that I could flip a pin from input to output and back, by bcf
> and bsf instructions on the TRIS registers.
>
> Apparently this isn't true.

Hmm, read somewhere you have to do a clrf PORTx before doing
the TRIS thing. Maybe in my old 16C84 datasheet, that was
a good one.

I always do tristating like this:

clrf PORTB
movlw b'00100011'
(comment the bits here)
movwf TRISB

I have never tried using a bsf or bcf for tristating.
-Roman

--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-requestspamspam@spam@mitvma.mit.edu


<3A507DFA.4ACE@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...