Ok, I think I figured it out.
Say I'm working on pin RA0. To make it work bidirectionally, I'm first going to clear LATA0 and then enable its internal pull up by setting WPUA0, and then set it as an input by setting TRISA0.
If the pin is supposed to be receiving information, all I have to do is read the state of RA0. If I want to output a logic high, all I have to do is leave things as they are (leave TRISA0 as set, that is), but if I want to output a logic low, then I will clear TRISA0. This latter situation will happen because LATA0 had already previously been cleared. At the end of the transmission TRISA0 will be back to being set to make sure that the pin functions as an input again.
Say I'm working on pin RA0. To make it work bidirectionally, I'm first going to clear LATA0 and then enable its internal pull up by setting WPUA0, and then set it as an input by setting TRISA0.
If the pin is supposed to be receiving information, all I have to do is read the state of RA0. If I want to output a logic high, all I have to do is leave things as they are (leave TRISA0 as set, that is), but if I want to output a logic low, then I will clear TRISA0. This latter situation will happen because LATA0 had already previously been cleared. At the end of the transmission TRISA0 will be back to being set to make sure that the pin functions as an input again.

