Setting TRISC=0 is the same as TRISC=%00000000.
PORTC=1 has now set Bits 7 thru 1 of that Port to OUTPUT LOW, and Bit 0 has been set OUTPUT HIGH... this is the same as setting PORTC=%00000001.
TRISC=%00000001 however as you correctly state, sets Bits 7 thru 1 as OUTPUT and Bit 0 as INPUT.
TRIS sets I/O Direction (either for INPUT or OUTPUT), whereas PORTC=x will physically set PORTC to the value of x.
It is always a good idea to initialise a PICs Ports with it's appropriate TRIS before performing any I/O. Don't rely on other commands to do it for you - they might not.
Bookmarks