Difference between PORT and LATCH on PIC 18F

Posted by acemtp on Stack Overflow See other posts from Stack Overflow or by acemtp
Published on 2010-04-12T16:00:10Z Indexed on 2010/04/12 16:03 UTC
Read the original article Hit count: 661

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about pic

Related posts about pic18