TRIS change?

Status
Not open for further replies.

zhaniko93

New Member
Hello.
I have a simple question: can I use one port as an input and as output?
I mean, I want to send 1 bit data from MCU A to B with one wire, so one idea came to my head: what if I just send a bit with wire, than change the according TRIS register and wait for response? Can I change TRIS in the middle of the program many times?
 
Yes, of course you can, and it's a VERY common technique - most commonly used to simulate an open-collector output pin, such as for I2C.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…