English
Language : 

PIC16F193X Datasheet, PDF (85/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
6.0 I/O PORTS
Depending on the device selected and peripherals
enabled, there are up to five ports available. In general,
when a peripheral is enabled, that pin may not be used
as a general purpose I/O pin.
Each port has three registers for its operation. These
registers are:
• TRISx registers (data direction register)
• PORTx registers (reads the levels on the pins of
the device)
• LATx registers (output latch)
The Data Latch (LATx registers) is useful for
read-modify-write operations on the value that the I/O
pins are driving.
Ports with analog functions also have an ANSELx
register which can disable the digital input and save
power. A simplified model of a generic I/O port, without
the interfaces to other peripherals, is shown in
Figure 6-1.
FIGURE 6-1:
GENERIC I/O PORT
OPERATION
PIC16F193X/LF193X
Read LATx TRISx
Write LATx
Write PORTx
D
Q
CK
Data Register
Data Bus
Read PORTx
To peripherals
ANSELx
VDD
I/O pin
VSS
© 2008 Microchip Technology Inc.
Preliminary
DS41364A-page 83