On Mon, 19 Mar 2001 09:23:35 -0000, you wrote:
>When you TRIS a pin as input, then read it, does that not put a logic 1 in
>the PORT register if the pin is pulled up? If so, when the pin is TRIS'd to
>output again, it will be outputting logic 1.??
No. However if you do a read-modify write (bsf,bcf) on another pin on the
port (e.g. SCL), and the input is pulled high externally. this WILL
rewrite the output register with a 1, so you do need to be careful. If
in doubt use a BCF or explicit zero write on the pin before turning it
back to an output. BCF is ok on the pin in question as it will ignore
the previous state, but this is not a good idea if there are other
input pins on the port whose output ports you don't want to change.
This is actually another argument for not using open-drain on SCL, so
you don't have to worry about messing up SCL when SDA changes!
>Therefore, care should be taken when doing I2C in this method to make sure
>that the pin is set to output 0 whenever you tris back to an output.
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
In reply to: <00a901c0b056$45f983b0$b802a8c0@bob>
See also: www.piclist.com/techref/i2cs.htm?key=i2c
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the