Peripheral Interfacing

Peripheral interfacing maps external devices to processor through programmable controllers and timing rules.

Key formulas & points

Skim these first — then read the full notes below.

  • Handshake lines STB, ACK, BUSY coordinate transfers
  • UART frame: start + data + optional parity + stop
  • Keyboard matrix scan uses row drive and column sense

Topic details

Introduction

Hamacher and Stallings describe peripheral interfacing as practical system integration. B.Tech questions typically ask 8255 control word, timer divisor, or ADC conversion calculations.

Key relations & formulas

Formulas (Indian textbook notation)

  • 8255PPIprovidesportsA,B,Cinmodes0,1,28255 PPI provides ports A, B, C in modes 0, 1, 2

Formulas (Indian textbook notation)

  • 8253/8254timeroutputfrequencyfout=fclkdivisor8253/8254 timer output frequency f_{out} = \frac{f_{clk}}{divisor}
ADCcode=(VinVref)×ADC code = (\frac{V_{in}}{V_{ref}}) \times
(2^n − 1)

Notation and sign conventions

Relation 1 —
8255PPIprovidesportsA,B,Cinmodes0,1,28255 PPI provides ports A, B, C in modes 0, 1, 2

Formulas (Indian textbook notation)

  • 8255PPIprovidesportsA,B,Cinmodes0,1,28255 PPI provides ports A, B, C in modes 0, 1, 2
Write this relation with symbols exactly as in Microprocessor Architecture & Programming — Ramesh Gaonkar before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 2 —
8253/8254timeroutputfrequencyfout=fclkdivisor8253/8254 timer output frequency f_{out} = \frac{f_{clk}}{divisor}

Formulas (Indian textbook notation)

  • 8253/8254timeroutputfrequencyfout=fclkdivisor8253/8254 timer output frequency f_{out} = \frac{f_{clk}}{divisor}
Write this relation with symbols exactly as in Microprocessor Architecture & Programming — Ramesh Gaonkar before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 3 —
ADCcode=ADC code =
ADCcode=(VinVref)×ADC code = (\frac{V_{in}}{V_{ref}}) \times
(2^n − 1)
Write this relation with symbols exactly as in Microprocessor Architecture & Programming — Ramesh Gaonkar before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.

Concept in depth

Interfacing requires electrical compatibility, addressing, and control sequencing. Programmable peripheral ICs reduce software burden by handling modes, handshakes, and timing generation. Analog peripherals add conversion resolution and sampling concerns. Reliable interface design includes status polling or interrupts and robust initialization flow.

Assumptions and validity limits

State assumptions explicitly before using any relation for peripheral interfacing — steady state, uniform properties, linear elastic material, ideal gas, incompressible flow, etc., as applicable.
Wrong assumptions invalidate the entire solution even when the formula is correct. In Microprocessors (Hardware) viva and GATE descriptive questions, listing valid assumptions often earns separate marks.

Step-by-step problem approach

1. Read the question and list given data with SI units (common in Microprocessors (Hardware) papers).
2. Draw a neat labelled diagram where applicable — examiners in Indian universities award diagram marks even when arithmetic slips.
3. Identify which relation from this topic applies to peripheral interfacing.
4. Use equation 1:
8255PPIprovidesportsA,B,Cinmodes0,1,28255 PPI provides ports A, B, C in modes 0, 1, 2
.
5. Use equation 2:
8253/8254timeroutputfrequencyfout=fclkdivisor8253/8254 timer output frequency f_{out} = \frac{f_{clk}}{divisor}
.
6. Substitute values, compute, and verify units and sign (direction).
7. State conclusion in one line — e.g. safe/unsafe, stable/unstable, feasible/infeasible.

Applications & exam relevance

Peripheral Interfacing appears in embedded boards and kits. In Indian computer hardware curricula this topic is tested because it connects theory to MPU architecture and interfacing.
GATE and semester exams often combine peripheral interfacing with earlier units — revise prerequisites before attempting mixed problems.
Industry interview panels sometimes ask: "Where did you use peripheral interfacing?" — answer with a lab, mini-project, or plant visit example if possible.

Common mistakes in exams

A common error is writing control words without matching bit-field meaning. Students also use ADC formula without scaling by (2^n − 1), causing one-step numerical mismatch.

Quick revision checklist

Before attempting peripheral interfacing problems, confirm you can:
1. Handshake lines STB, ACK, BUSY coordinate transfers
2. UART frame: start + data + optional parity + stop
3. Keyboard matrix scan uses row drive and column sense
Revise the solved examples in Microprocessor Architecture & Programming — Ramesh Gaonkar and one previous-year GATE or university paper for this unit.

Worked examples

Try the problem first — open the solution when you are ready to check.

Timer divisor calculation

Problem

For 8254 with clock 2 MHz, set output to 5 kHz. Find divisor.

Solution

Divisor = f_clk/f_out = 2,000,000 / 5,000 = 400 (0190H).

Conceptual check — Peripheral Interfacing

Problem

In a Microprocessors (Hardware) semester or GATE paper you are asked: "State the main assumption, the governing relation, and one practical consequence of peripheral interfacing." What should a complete answer include?

📖 Standard books (India)

  • Microprocessor Architecture & ProgrammingRamesh Gaonkar

    Read: Syllabus unit

    8085/8086 — widely used in Indian colleges