---
title: "Keyboard and printer interface in 8255 mode 1"
subject: "Instrumentation II"
chapter: 2
key: "semester_5/instrumentation_ii:keyboard-printer-mode1"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/keyboard-printer-mode1
site: BCT Engineering
---

# Keyboard and printer interface in 8255 mode 1

Instrumentation II · Chapter 2: Parallel Interfacing With Microprocessor Based System

- Asked in: 2071 Chaitra, 6 marks
- Video: [Interfacing 8255 With Printer(हिन्दी )](https://www.youtube.com/watch?v=MYEsuzht7lg) — LEARN AND GROW
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/keyboard-printer-mode1
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-2

## Question

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.

## 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).

## Answer

#### 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
```text
 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).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which signal tells the keyboard that the 8255 input buffer is full?
   A. IBF_A on PC5
   B. STB_A' on PC4
   C. OBF_B' on PC1
   D. INTR_A on PC3
   Answer: A. IBF acknowledges the data to the keyboard; STB' is from the keyboard. (Key point: Mode 1 roles)

2. How is the printer on port B handled?
   A. By interrupt on RST 6.5
   B. By DMA
   C. By ignoring handshake
   D. By status check, reading OBF_B' bit of port C
   Answer: D. INTR_B is unused; the program polls port C to see if the printer took the previous byte. (Key point: Interrupt vs status)

3. What is the control word for A mode 1 input, B mode 1 output?
   A. A6H
   B. B0H
   C. 94H
   D. B4H
   Answer: D. 1 01 1 0 1 0 0 = 1011 0100 = B4H. (Key point: Control word)

4. If CS' is low for A7=1 and A6-A2 = 0, what is the control register address?
   A. 80H
   B. 81H
   C. 83H
   D. 82H
   Answer: C. A1 A0 = 11 selects control, so 80H + 3 = 83H. (Key point: Address map)

## Related in Instrumentation II

- [8255 mode 1 keyboard and printer with decoding](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Appi-keyboard-printer-mode1-fig) — Instrumentation II, chapter 2
- [Keyboard and printer with 8255A at 4044H](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Akbd-printer-ppi-4044h) — Instrumentation II, chapter 2
- [PCI bus; 8255 printer interface at 5500H](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Apci-printer-5500h) — Instrumentation II, chapter 2
- [Centronics printer with 8255A in mode 1](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acentronics-printer-8255-mode1) — Instrumentation II, chapter 2
- [8255 mode 0 DIP switches and LEDs](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Appi-mode0-dip-leds) — Instrumentation II, chapter 2
- [8255 at A0A0H: interface and control words](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Appi-a0a0h-control-words) — Instrumentation II, chapter 2

## Related in other subjects

- [Address decoding for input and output ports](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Adecoder-input-output-port-block-decoder) — Microprocessor, chapter 4
- [Address decoding for 8 LEDs output port](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Adecoder-output-port-8-leds) — Microprocessor, chapter 4
- [Address decoding for input port at 8050H](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Adecoder-input-port-lda-8050h) — Microprocessor, chapter 4
