9.1 Parallel I/O (PIO) Ports
All port pins have 12 registers directly associated with their operation
as digital I/Os. The Data Direction register (TRISx) determines whether the pin is an
input or an output. If the data direction bit is a ‘1
’, then the pin is
an input.
All port pins are defined as inputs after a Reset. Reads from the latch (LATx), read the latch. Writes to the latch, write the latch. Reads from the port (PORTx), read the port pins, while writes to the port pins, write the latch. Any bit and its associated data and control registers that are not valid for a particular device are disabled. This means the corresponding LATx and TRISx registers, and the port pin are read as zeros.
When a pin is shared with another peripheral or function that is defined as an input only, it is nevertheless regarded as a dedicated port because there is no other competing source of outputs. Table 9-1 shows the pin availability. Figure 9-1 shows the 5V input tolerant pins across this device.
Device | Rx15 | Rx14 | Rx13 | Rx12 | Rx11 | Rx10 | Rx9 | Rx8 | Rx7 | Rx6 | Rx5 | Rx4 | Rx3 | Rx2 | Rx1 | Rx0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PORTA | ||||||||||||||||
dsPIC33CKXXXMPT608-I/PT | — | — | — | — | — | — | — | — | — | — | — | X | X | X | X | X |
ANSELA | — | — | — | — | — | — | — | — | — | — | — | X | X | X | X | X |
PORTB | ||||||||||||||||
dsPIC33CKXXXMPT608-I/PT | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
ANSELB | — | — | — | — | — | — | X | X | X | — | — | — | X | X | X | X |
PORTC | ||||||||||||||||
dsPIC33CKXXXMPT608-I/PT | X | X | X | X | — | — | X | X | X | X | — | — | X | X | X | X |
ANSELC | — | — | — | — | — | — | — | — | X | X | — | — | X | X | X | X |
PORTD | ||||||||||||||||
dsPIC33CKXXXMPT608-I/PT | X | X | X | X | X | X | X | X | X | X | X | — | — | X | X | X |
ANSELD | — | — | X | — | X | X | — | — | — | — | — | — | — | — | — | — |
PORTE | ||||||||||||||||
dsPIC33CKXXXMPT608-I/PT | X | X | — | X | X | X | X | X | X | X | X | X | X | X | X | X |
ANSELE | — | — | — | — | — | — | — | — | — | — | — | — | X | X | X | X |