Memory & Peripheral Interfacing

Connecting a processor to memory and I/O. Learn memory types (SRAM, DRAM, ROM, Flash, EEPROM), address decoding and memory maps, chip capacity and expansion, memory-mapped vs isolated I/O, wait states and access timing, programmable peripherals (8255, 8253/8254, 8251, 8259), and DMA.

A processor alone does nothing useful — it needs program memory, data memory and peripherals. Interfacing means wiring address, data and control lines so each device responds only at its assigned addresses, with timing the devices can meet.

An analogy

A memory map is like a street directory: each house (chip) has a range of addresses, and the address decoder is the postman delivering to the right door.

Memory types

ROM/Flash (non-volatile program storage), EEPROM (byte-writable non-volatile), SRAM (fast, static, no refresh — caches and MCU RAM), DRAM (dense, needs refresh — main memory, DDR). Memory is organised as words × bits (e.g. 8K × 8).

Address decoding

Lower address lines go to every chip; higher lines feed a decoder that asserts one chip select. Full decoding gives unique addresses; partial decoding saves logic but creates mirror images.

I/O interfacing

Memory-mapped I/O treats peripheral registers as memory (ARM, most MCUs). Isolated I/O uses separate IN/OUT instructions (8085/x86). Classic peripherals: 8255 parallel ports, 8254 timer, 8251 USART, 8259 interrupt controller, 8237 DMA.

Timing and DMA

If a device is slower than the bus cycle, insert wait states (READY line). DMA controllers move data between memory and peripherals without CPU involvement — essential for high data rates. Modern buses (AHB/AXI) add bursts and arbitration.

Formulas

Worked example: Memory expansion

Given: Need 64 KB RAM from 16 K × 8 chips

Find: Chips and address lines.

Answer: 4 chips, 2-to-4 decoder on A15–A14

Worked example: Wait states

Given: Flash t_acc = 70 ns; CPU allows 45 ns at 40 MHz (T = 25 ns)

Find: Wait states.

Answer: 1 wait state

Common mistakes

Applications

Key takeaways

Going further