16.2 Digital I/O Configuration Register
The direction control register is programmed by writing to Base + 15 using the format below. Once you have set the port directions with this register, you can read and write to the ports as desired.
Digital I/O Configuration Register: Page 1, Base + 15
Bit No | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Name | 1 | ModeC | ModeA | DirA | DirCH | ModeB | DirB | DirCL |
Definitions:
1 | Bit 7 must be set to 1 to indicate port mode set operation |
DirA | Direction control for bits A7 – A0: 0 = output, 1 = input |
DirB | Direction control for bits B7 – B0: 0 = output, 1 = input |
DirCL | Direction control for bits C3 – C0: 0 = output, 1 = input |
DirCH | Direction control for bits C7 – C4: 0 = output, 1 = input |
ModeA, ModeB, ModeC I/O Mode for each port, 0 or 1
Here is a list of common configuration register values:
Configuration Byte
Hex | Decimal | PortA | PortB | PortC |
9B | 155 | Input | Input | Input |
92 | 146 | Input | Input | Output |
99 | 153 | Input | Output | Input |
90 | 144 | Input | Output | Output |
8B | 139 | Output | Input | Input |
82 | 130 | Output | Input | Output |
89 | 137 | Output | Output | Input |
80 | 128 | Output | Output | Output |
Last updated