Precisely.
If you wish to use a pin (or indeed an entire Port) for Input and Output, all you do is simply change the TRIS for that pin or that whole Port before you perform any I/O.
Once you set TRIS, it stays that way until you change it. Note that some PBP commands change TRIS on pins as required by that command, but for clarity, you should always set TRIS for whatever you happen to need it for.
There is no restriction as to how many times you can change the TRIS status within your program.
Bookmarks