A microprocessor communicates with peripherals through a combination of data buses, address buses, control signals, and specific I/O techniques. The goal is to send data, receive input, and control external devices like sensors, displays, keyboards, and communication modules.
Main Components Involved
Communication Methods
1. Memory-Mapped I/O (MMIO)
Used by ARM (e.g., STM32), MIPS, RISC-V
- Peripherals are assigned memory addresses
- CPU uses normal instructions to access them (e.g., LDR, STR in ARM)
- Example: 0x40020000 could be a GPIO register
c
#define GPIO_DATA (*(volatile unsigned int *)0x40020000)
GPIO_DATA = 0xFF; // Send data to GPIO
2. Port-Mapped I/O (PMIO)
Used by Intel x86 (e.g., 8086)
- Peripherals are in a separate I/O space
- Accessed with special instructions like IN, OUT
asm
mov dx, 0x03F8 ; COM1 serial port
mov al, 'A'
out dx, al ; Send character to peripheral
Data Transfer Mechanisms
Control Signals Used
Visual Overview:
css
┌────────────────────────┐
│ Microprocessor │
└──────┬────┬────┬───────┘
│ │ │
┌────────▼────▼────▼────────┐
│ Address Data Control │ ← Buses
└────────┬────┬────┬────────┘
│ │ │
┌───────────▼┐ ┌▼───────────┐
│ Memory │ │ Peripheral │ ← (e.g., GPIO, UART, LCD)
└────────────┘ └────────────┘
Summary
Top comments (0)