I/O Interface, Interrupts, DMA Controllers & Serial Communication
Programmed I/O vs Interrupt-driven I/O vs Direct Memory Access (DMA), DMA controller modes (Burst vs Cycle Stealing), vectored interrupt hardware, and synchronous/asynchronous UART communication.
Learning Objectives
- •Compare Programmed I/O, Interrupt-Driven I/O, and DMA transfer rates.
- •Draw the internal architecture of a DMA controller (Address, Word Count, Control registers).
- •Trace the interrupt execution lifecycle including context saving and RETI instruction.
- •List key 8051 SFRs (ACC, B, PSW, TMOD, TCON, SCON, IE, IP) and explain their memory mapping.
Essential Prerequisites
- •System bus arbitration
- •Stack PUSH and POP operations
DMA Controller aur Interrupts - CPU ko bina disturb kiye Data Transfer
Agar CPU ko keyboard, mouse, sound card aur hard drive se ek-ek byte data khud manually copy karna pade, toh CPU ka 90% time sirf clerk ka kaam karne mein nikal jayega! Isliye hardware mein do super features hote hain: Interrupts aur Direct Memory Access (DMA). Interrupt ka matlab hai ki mouse ya network card CPU ko signal deta hai: 'Boss, mere paas data tayyar hai, jab free ho toh dekh lena'. Aur DMA Controller ek specialized chip hai jo high-speed devices (jaise SSD ya NIC) ka data seedhe RAM mein copy kar deti hai bina CPU ko pareshan kiye (Cycle Stealing ya Burst mode mein).
Restaurant mein waiter vs chef: Agar chef khud table pe jaakar order le aur bill banaye (Programmed I/O), toh khana kab banega? Chef kitchen mein cooking karta hai (CPU processing), aur dedicated waiters (DMA Controllers) samaan aur dishes serve karte rehte hain!
Programmed I/O vs Interrupt-Driven I/O vs DMA ka comparison chart pakka 7 ya 10 marks ka question hota hai! Cycle Stealing ka definition ratt lo: 'DMA controller CPU se bas 1 bus cycle chheen leta hai jab CPU internal ALU operations mein busy ho, taaki CPU execution zero delay pe chalta rahe.'
Vectored Interrupt vs Non-Vectored Interrupt: 'Vectored Interrupt mein interrupting device khud bus par ek binary number (Vector Address) bhejti hai jo Interrupt Vector Table (IVT) mein uske handler ka seedha function pointer hota hai. Non-vectored mein CPU ko saare devices ko ek-ek karke poll karna padta hai.'
The Core Mental Model
Why This Exists
When an SSD reads a 4K video at 7000 MB/s, if the CPU had to move every single byte through an accumulator register, your computer would freeze completely. DMA allows peripherals to copy data straight into RAM while the CPU keeps running your games and browsers.
Beginner Foundation
Your keyboard, mouse, screen, and hard drive are much slower than the CPU. The computer needs smart ways to talk to them without waiting for minutes. Interrupts and DMA let the CPU do important math while background chips handle the slow typing and printing.
Micro Concepts Decomposition
Three Modes of I/O Data Transfer
1) Programmed I/O: CPU polls device busy flag continuously in a busy-wait loop (100% CPU waste). 2) Interrupt-Initiated I/O: CPU executes other tasks; device raises hardware interrupt when ready. 3) Direct Memory Access (DMA): Dedicated hardware chip transfers large data blocks between I/O and RAM with zero CPU intervention.
DMA Controller Operation: Burst vs Cycle Stealing Mode
In Burst Mode, the DMA controller takes complete control of the system bus and transfers an entire block before releasing it. In Cycle Stealing Mode, the DMA controller steals exactly one memory bus cycle per transfer from the CPU, interleaving transfers without freezing CPU execution.
Interrupt Hardware, Priority & Vector Tables
When an interrupt occurs: 1) CPU finishes current instruction. 2) Saves PC and Flags on Stack. 3) Acknowledges with INTA signal. 4) Device places Interrupt Vector on data bus. 5) CPU jumps to Interrupt Service Routine (ISR) address found in Interrupt Vector Table (IVT).
8051 Microcontroller Architecture & Special Function Registers (SFRs)
The 8051 has 128 bytes internal RAM and 21 SFRs mapped at addresses 80H-FFH: Accumulator (ACC, E0H), B register (F0H), Program Status Word (PSW, D0H), Stack Pointer (SP, 81H), Data Pointer (DPTR, 82H-83H), Timer Mode (TMOD, 89H), Timer Control (TCON, 88H), and I/O Ports P0-P3.
Hardware State Machine Architecture
Interactive Simulator
Bus Arbitration Protocols & Priority Resolution Laboratory
Daisy Chaining: Lowest hardware cost (requires only 3 control lines regardless of master count). However, propagation delay is proportional to device count ($O(n)$), and any device failure in the chain breaks grant transmission down the line.
End-to-End Execution Trace
Step-by-Step Code Execution (C)
Sandbox Terminal Ready
Click Run Code or press Ctrl+Enter to compile and execute.
Where Students Lose Marks
Active Assessment Quiz
No Practice Questions Configured
Questions for this topic are currently undergoing faculty review.