Difference between PORT and LATCH on PIC 18F
- by acemtp
I already read the datasheet and google but I still don't understand something.
In my case, I set PIN RC6 of a PIC18F26K20 in INPUT mode:
TRISCbits.TRISC6 = 1;
Then I read the value with PORT and LATCH and I have different value!
v1 = LATCbits.LATC6;
v2 = PORTCbits.RC6;
v1 gives me 0 where v2 gives 1.
Is it normal? In which case we have to use PORT and in which case LATCH?