Unit 2
Memory Types in Embedded Systems
Memory in an embedded system is used for storing program code, temporary data, and system
con gurations. It is classi ed based on storage type, access speed, and volatility.
1. Primary Memory (Main Memory)
💾 Directly accessed by the processor for fast execution.
a) Read-Only Memory (ROM)
✔ Non-volatile (data remains even after power off).
✔ Stores rmware
types of ROM:
• PROM (Programmable ROM): Can be programmed once.
• EPROM (Erasable PROM): Can be erased using UV light.
• EEPROM (Electrically Erasable PROM): Can be erased and reprogrammed electrically.
• Flash Memory: Faster than EEPROM, used in USB drives, SD cards.
b) Random Access Memory (RAM)
✔ Volatile (data is lost when power is off).
✔ Used for temporary storage
Types of RAM:
• SRAM (Static RAM): Fast, expensive, used in cache memory.
• DRAM (Dynamic RAM): Slower, needs refreshing, used in main memory.
2. Secondary Memory (Storage Memory)
💾 Stores data permanently.
a) Hard Disk Drives (HDDs) & Solid-State Drives (SSDs)
HDDs use magnetic storage, while SSDs use ash memory.
✔ SSDs are faster and more durable than HDDs.
fi
fi
fi
fl
b) Memory Cards (SD Cards, USB Drives)
✔ Portable ash storage for external data transfer.
3. Cache Memory
💾 Small, high-speed memory located inside the processor.
✔ Stores frequently accessed data to speed up processing.
4. Virtual Memory
💾 Uses a portion of secondary storage (HDD/SSD) as extra RAM.
✔ Helps run large applications when RAM is full.
5. Register Memory
💾 Fastest memory inside the CPU (small storage).
✔ Holds temporary values, addresses, and instructions.
6. Embedded Non-Volatile Memory (NVM)
💾 Built inside microcontrollers and processors for permanent storage.
xample: In an IoT device, NVM stores Wi-Fi credentials.
fl
Memory Maps and Addresses in Embedded Systems
Memory mapping is a technique used to organize memory in embedded systems by assigning
speci c address ranges to different memory types (RAM, ROM, I/O, etc.). It helps the processor
access and manage memory ef ciently.
1. Memory Addressing
Each memory location in an embedded system has a unique address, which the processor uses to
read/write data
Example: In a 32-bit system, memory addresses range from 0x00000000 to 0xFFFFFFFF
✅ Types of Memory Addressing:
1⃣ Byte Addressing: Each memory location stores 1 byte (8 bits).
2⃣ Word Addressing: Memory is accessed in words (16-bit, 32-bit, etc.).
2. Memory Map
A memory map de nes how different memory regions are arranged in an embedded system.
It divides the processor's address space into speci c sections for:
• ROM (Firmware/Program Memory)
• RAM (Data Memory, Stack, Heap)
• I/O Devices (Peripherals like UART, Timers, GPIO)
3. Types of Memory Mapping
1⃣ Linear Memory Mapping
✔Memory addresses are continuous and sequential.
2⃣ Segmented Memory Mapping
✔Divides memory into segments (Code, Data, Stack)
3⃣ Virtual Memory Mapping
✔Maps physical memory to a logical address space.
fi
fi
fi
fi
Importance of Memory Maps in Embedded Systems
Ef cient Memory Allocation: Helps allocate ROM, RAM, and I/O space properly.
Faster Execution: Reduces memory access delays.
Prevents Overlapping: Ensures different memory regions don’t interfere.
Allows direct access to hardware registers
fi