8. 82C55 DIGITAL I/O CHIP OPERATION
This is a short form description of the 82C55 digital I/O chip on the board. A full datasheet is included at the back of this manual.
82C55 Register Map |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Base + n, Dir, Function | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
|
|
|
|
|
|
|
|
|
4, R/W, Port A | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 |
|
|
|
|
|
|
|
|
|
5, R/W, Port B | B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0 |
|
|
|
|
|
|
|
|
|
6, R/W, Port C | C7 | C6 | C5 | C4 | C3 | C2 | C1 | C0 |
|
|
|
|
|
|
|
|
|
7, W, Config Register | 1 | ModeC | ModeA | DirA | DirCH | ModeB | DirB | DirCL |
|
|
|
|
|
|
|
|
|
Configuration Register
The configuration register is programmed by writing to Base + 7 using the format below. Once you have set the port directions with this register, you can read and write to the ports as desired.
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 (others are possible):
Configuration Byte |
|
|
|
| |
Hex | Decimal | Port A | Port B | Port C (both halves) | |
9B | 155 | Input | Input | Input | (all ports 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 | (all ports output) |
Copyright 2001 Diamond Systems Corp. |