Past exam question: 2082 Chaitra (Regular), Q9(c)
Open in the Padhaiko appQuestion
Explain how control word is made in Intel 8255A PPI.
Solution
Control Word Format for I/O Mode (Bit D7 = 1): To configure ports in I/O mode, an 8-bit control word is written to the Control Word Register (selected when A1 = 1, A0 = 1, and CS\_bar = 0):
| Bit | Name | Function / Setting |
|---|---|---|
| D7 | Mode Set Flag | 1 = I/O Mode, 0 = BSR Mode |
| D6, D5 | Group A Mode | 00 = Mode 0, 01 = Mode 1, 1X = Mode 2 |
| D4 | Port A Direction | 1 = Input, 0 = Output |
| D3 | Port C Upper (PC7–PC4) | 1 = Input, 0 = Output |
| D2 | Group B Mode | 0 = Mode 0, 1 = Mode 1 |
| D1 | Port B Direction | 1 = Input, 0 = Output |
| D0 | Port C Lower (PC3–PC0) | 1 = Input, 0 = Output |
Illustrative Construction Example: Suppose we need to configure:
- Port A as Input in Mode 0
- Port B as Output in Mode 0
- Port C Upper as Output
- Port C Lower as Input
Step-by-step bit assignment:
- D7 =
1(I/O Mode) - D6, D5 =
00(Group A Mode 0) - D4 =
1(Port A Input) - D3 =
0(Port C Upper Output) - D2 =
0(Group B Mode 0) - D1 =
0(Port B Output) - D0 =
1(Port C Lower Input)
Binary: 1001 0001b = 91H. Writing 91H to the control port sets up this operational configuration.
Answer:
The I/O control word is formed by setting D7=1, configuring Group A mode (D6-D5) and directions for Port A (D4) and Port C Upper (D3), then Group B mode (D2) and directions for Port B (D1) and Port C Lower (D0).