Difference between PORT and LATCH on PIC 18F

前端 未结 8 812
南旧
南旧 2020-12-04 22:02

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:

TRI

8条回答
  •  无人及你
    2020-12-04 22:42

    My recommendation is to regard the PORT values as read-only. The LAT values may be read or written, but the value read will be the last value written, not the input value of the pin.

    On older PICs, the LATx values didn't exist; the only way to write to a port was via the PORTx registers. Curiously, some of the really old PICs, back from the General Instruments (pre-Microchip) days, supported LATx, but Microchip didn't add that feature until the PIC18x line.

提交回复
热议问题