EmbeddedRelated.com

DDR

Category: Memory | Also known as: ddr sdram, double data rate

DDR SDRAM (Double Data Rate Synchronous Dynamic Random-Access Memory) is a type of volatile DRAM that transfers data on both the rising and falling edges of the clock signal, effectively doubling the data throughput compared to single data rate (SDR) SDRAM at the same clock frequency. Successive generations (DDR2, DDR3, DDR3L, DDR4, DDR5, and LPDDR variants) increase bandwidth, reduce supply voltage, and improve efficiency.

In practice

DDR SDRAM is the dominant main memory technology in application-class embedded systems: Linux-capable SoCs such as NXP i.MX series, Raspberry Pi (BCM2711), Allwinner, Rockchip, and Qualcomm Snapdragon-based modules nearly all use DDR3, DDR4, or LPDDR4/5 as their primary RAM. Microcontroller-class devices (Cortex-M, PIC, AVR, MSP430) typically rely on on-chip SRAM instead; DDR generally does not appear in that design tier because it requires a dedicated memory controller and a carefully matched PCB layout.

The DDR memory controller is almost always integrated into the SoC itself. Bringing up DDR requires training sequences that calibrate timing parameters (read/write leveling, DQS alignment, ZQ calibration) during boot. On bare-metal or U-Boot bringup, this initialization code is one of the most sensitive parts of the system: incorrect timing registers, wrong impedance settings, or PCB trace length mismatches can cause hard-to-reproduce data corruption rather than clean failures. The "habitat of hardware bugs" concept applies directly here, since DDR errors can manifest only under specific temperature, frequency, or data-pattern conditions.

LPDDR (Low Power DDR) variants are common in battery-powered embedded Linux designs. LPDDR4X, for example, reduces the I/O signaling voltage to 0.6 V compared to DDR4's 1.2 V I/O voltage, meaningfully reducing power in always-on or mobile applications. LPDDR memory is typically packaged as PoP (Package-on-Package) stacked directly on the SoC, as seen in many smartphone and embedded module designs, which eliminates the routing challenge but also means the memory is not field-replaceable.

A practical concern for embedded developers is that DDR requires periodic refresh cycles managed by the memory controller; during low-power states, the controller must either keep refresh running (self-refresh mode) or accept that memory contents are lost. System designers must also account for DDR bandwidth budgeting when multiple masters (CPU cores, GPU, display, DMA engines) share the bus, since memory contention can introduce latency that violates real-time deadlines.

Frequently asked

What is the difference between DDR, DDR2, DDR3, DDR4, and DDR5?
Each generation increases prefetch depth, peak data rate, and number of banks while reducing supply voltage. DDR3 typically runs at 1.5 V (with low-voltage DDR3L at 1.35 V) with speeds roughly from 800 to 2133 MT/s; DDR4 runs at 1.2 V from around 1600 to 3200+ MT/s; DDR5 drops to 1.1 V and starts at 3200 MT/s with higher burst lengths and on-die ECC. Exact speed grades and voltage variants depend on JEDEC specifications and vendor bins. The generations are not pin-compatible with each other. The SoC's integrated memory controller determines which generation(s) a given design can use.
What is LPDDR and when is it used in embedded designs?
LPDDR (Low Power DDR) is a family of DDR variants (LPDDR3, LPDDR4, LPDDR4X, LPDDR5) optimized for mobile and embedded use. They operate at lower I/O voltages (down to 0.6 V for LPDDR4X) and support deep power-saving modes. They are common in application processors used in smartphones, tablets, and embedded modules like the Raspberry Pi Compute Module or NXP i.MX 8M-based boards. The tradeoff is that LPDDR is typically soldered or PoP-mounted, so capacity is fixed at board design time.
Why is DDR initialization so difficult during bare-metal or bootloader bringup?
DDR training requires the memory controller to measure and compensate for signal propagation delays, impedance mismatches, and process/voltage/temperature variation. This involves sequences like write leveling, read DQ/DQS centering, and ZQ calibration, which must run before the memory is usable. Getting these wrong causes intermittent bit errors rather than immediate hard faults, making debugging difficult. Most production designs rely on vendor-supplied initialization code (from the SoC vendor or a memory vendor's SDP tool) and validated board layouts with controlled trace lengths and termination.
Can DDR memory be used with standard Cortex-M microcontrollers?
A small number of higher-end Cortex-M7 devices include an external memory controller (FMC/FSMC) that can interface with SDRAM, but this is typically SDR SDRAM (not DDR). True DDR support is rare on Cortex-M class parts. Most embedded designs that need DDR-class bandwidth use an application processor (Cortex-A or similar) rather than a microcontroller. If a resource-constrained design needs more memory than on-chip SRAM provides, alternatives like PSRAM or external SPI/QSPI flash are more commonly used.
How does DDR self-refresh work, and why does it matter for low-power designs?
DRAM cells leak charge and must be refreshed periodically or data is lost. In self-refresh mode, the DRAM device handles refresh internally without requiring the external memory controller to remain active, allowing the SoC to enter a deep sleep state while preserving memory contents. Exiting self-refresh adds latency before the memory is accessible again. Designs that need fast wake times from sleep must account for this exit latency when selecting their low-power strategy.

Differentiators vs similar concepts

DDR SDRAM is often confused with or loosely compared to SRAM and PSRAM. SRAM (static RAM) requires no refresh, has lower latency, and is simpler to interface, but is much more expensive per bit and area-inefficient; it is the standard for on-chip RAM in microcontrollers. PSRAM (pseudo-static RAM) uses a DRAM cell array with an internal refresh controller and a parallel or SPI-style interface (implementations vary by vendor), making it easier to attach to microcontrollers without a dedicated memory controller, at the cost of lower bandwidth than true DDR. DDR SDRAM itself should not be confused with DDR used in other contexts (e.g., DDR signaling in SerDes links), which refers to the double-edge clocking technique rather than the specific JEDEC SDRAM standard.