- 2071 Chaitra · 6 marks
Keyboard and printer interface in 8255 mode 1
Short answer
Port A mode 1 input (keyboard, interrupt-driven), port B mode 1 output (printer, status check). Control word B4H; enable keyboard interrupt with BSR 09H. Addresses: A=80H, B=81H, C=82H, control=83H (I/O mapped). Printer status checked via OBF_B' (PC1).
Interface a keyboard and a printer in mode 1. Port A is designed as input for keyboard with interrupt I/O port B is designed as output for printer with status check I/O. Draw the mapping circuit and write the control word and address map.
Assumptions
8085, 8255 I/O mapped at 80H-83H. Keyboard encoder on port A (interrupt driven, mode 1 input); printer on port B (status check, mode 1 output).
Signals (mode 1)
| Port C pin | Signal | Use |
|---|---|---|
| PC4 | STB_A' | Strobe from keyboard |
| PC5 | IBF_A | Acknowledge to keyboard |
| PC3 | INTR_A | Interrupt to 8085 (RST 6.5) |
| PC1 | OBF_B' | Data ready to printer |
| PC2 | ACK_B' | Acknowledge from printer |
| PC0 | INTR_B | Not used (status read instead) |
Mapping circuit
A7 ------------+ +--------------+
A6..A2 [NOR]---+--[AND]--[NOT]->CS' |
IO/M(=1) ------+ | 8255A |
A1, A0 ------------------------> A1, A0 |
IOR' -> RD' IOW' -> WR' RESET OUT -> RESET |
AD0-AD7 -> D0-D7 |
PA0-PA7 <- keyboard PB0-PB7 -> printer |
PC4 <- STB' PC5 -> IBF PC3 -> RST 6.5 |
PC1 -> printer DATA READY PC2 <- printer ACK +
CS' is low when A7 = 1 and A6-A2 = 00000.
Address map
| A1 A0 | Port | Address |
|---|---|---|
| 00 | Port A (keyboard) | 80H |
| 01 | Port B (printer) | 81H |
| 10 | Port C (status) | 82H |
| 11 | Control | 83H |
Control word
D7 = 1 (mode set), D6D5 = 01 (port A mode 1), D4 = 1 (A input), D3 = 0 (PC6, PC7 output, unused), D2 = 1 (B mode 1), D1 = 0 (B output), D0 = 0 = 1011 0100 = B4H. INTE_A enable (keyboard interrupt): BSR 0000 1001 = 09H (set PC4). Printer status is checked by reading port C bit D1 (OBF_B' = 1 means printer took the previous byte).
✓ Answer checked by Claude Sonnet 5.5
Related questions
- 8255 mode 1 keyboard and printer with decoding · Instrumentation II, chapter 2
- Keyboard and printer with 8255A at 4044H · Instrumentation II, chapter 2
- PCI bus; 8255 printer interface at 5500H · Instrumentation II, chapter 2
- Centronics printer with 8255A in mode 1 · Instrumentation II, chapter 2
- 8255 mode 0 DIP switches and LEDs · Instrumentation II, chapter 2
- 8255 at A0A0H: interface and control words · Instrumentation II, chapter 2
- Address decoding for input and output ports · Microprocessor, chapter 4
- Address decoding for 8 LEDs output port · Microprocessor, chapter 4
- Address decoding for input port at 8050H · Microprocessor, chapter 4