I'm a beginner when it comes to coding in C. How do i set a single port pin as output using C. i know in assembly we set it using "bsf PORTB,0 " syntax. how do i do the same thing using C? thanks
If you are using C30 compiler then, TRIS registers are there which are used as direction registers. If you want to use 0th pin of PORTB as a output then TRISBbits.TRISB0=0;
for input TRISBbits.TRISB0=1; same for other ports. But check first that default setting for pins.