by Brian Griffin » Fri May 06, 2011 3:48 pm
syntium87 WROTE:i'm using pic16f877a and mplab to program the pic....
i got this problem..how to set one of the pic port to become input and output together..?(like set a pic port pin that can be input and output)..
can it be done??
wht should i write on the c program??? help pls...
You cannot make the port pin to become input and output together. But however, you can turn it into an output or an input one at the time.
Input : TRISX.RY = 1
Output: TRISX.RY = 0
(X denotes the Port, and Y denotes the pin number/bit)
Hope that helps.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool