Embedded Hardware Notes
Embedded Hardware from Software Programmer's Perspective
7.1 Introduction
- Importance of understanding hardware in embedded systems
- Programming embedded systems differs from traditional computer programming.
- Knowledge of hardware components and their rules is essential for software development in embedded systems.
7.2 Components of an Embedded System
- Key points before coding:
- Understand the purpose of the embedded system.
- Identify individual components involved.
- Learn how data flows through these components.
- Example: Printer-sharing device
- Connects two computers to one printer.
- Data flow from serial ports to RAM, then to the printer via the parallel port.
- Software is stored in ROM.
- Role of the Processor:
- Communicates with memory and peripherals.
- Memory types:
- RAM (Random Access Memory) - volatile storage.
- ROM (Read-Only Memory) - non-volatile storage.
- Peripheral - Interfaces with external devices (e.g., serial ports).
7.3 Memory Map
- Acts as a "address book" for the processor to interact with memory and peripherals.
- Key features:
- Includes entries for all memory and peripheral devices accessible from processor's memory space.
- Defined through address bus and data bus communication.
- Importance of structuring memory maps:
- List devices with their memory addresses in descending order.
- Mark unused memory regions.
- Example Memory Structure:
- RAM at lower end (128 KB up).
- ROM at higher end (256 KB down, includes EPROM and Flash memory).
- Peripheral register ranges defined clearly.
7.4 I/O Map
- Represents peripheral devices when a distinct I/O space is exercised.
- Creation:
- Similar method to memory maps; lists peripheral names and address ranges.
- Example I/O Map:
- Components like PCB, parallel port, and debugger port retained for managing printer and debugging tasks.
7.5 Interrupt Map
- Communication Techniques:
- Polling: Processor continuously checks devices for tasks.
- Interrupts: Peripheral sends signals to processor for attention.
- Interrupt Handling:
- Processor captures the interrupt and executes a routine (ISR).
- The mapping of interrupts to ISRs through an interrupt vector table.
- Importance of the Interrupt Map:
- Maintain correlation between interrupt types and associated ISRs.
8 Embedded Systems: Memory
8.1 Introduction
- Overview and classification of different memory types in embedded systems.
8.2 Types of Memory
- Three main categories:
- RAM:
- Fast, volatile, read/write memory.
- ROM:
- Slow, non-volatile, read-only memory.
- Hybrid:
- Combination of RAM and ROM functions.
8.3 Types of RAM
- SRAM (Static RAM):
- Retains data while powered but loses it when power is off.
- DRAM (Dynamic RAM):
- Requires refreshing to maintain data as it loses it quickly, uses controllers for data retention.
8.4 Types of ROM
- Masked ROM:
- Hardwired, unmodifiable, low-cost production.
- PROM (Programmable ROM):
- One-time programmable, cannot be altered once data is written.
- EPROM (Erasable and Programmable ROM):
- Can be erased and reprogrammed with UV light, useful for development.
8.5 Types of Hybrid Memory
- EEPROM (Electrically Erasable and Programmable ROM):
- Can be erased electrically byte-by-byte.
- Flash Memory:
- Non-volatile, popular, fast reading but sector-wise erasure.
- NVRAM (Non-Volatile RAM):
- SRAM with battery backup for data retention when the power is off. Common in embedded systems.