Home / Learn Embedded C / A Quick Tour of Bus Architectures
A Quick Tour of Bus Architectures
How internal buses connect the CPU core to memory and peripherals at different speeds.
Breaking it down
What it is
A chip's internal bus architecture (often multiple separate buses, like a fast bus for the CPU/RAM and a slower bus for peripherals) determines how quickly different parts of the memory map can be accessed, and why peripheral access is sometimes noticeably slower than RAM access.
Why it matters
Understanding that "peripheral bus" access can be meaningfully slower than RAM access explains some otherwise-surprising timing behavior (like why a tight register-polling loop runs slower than an equivalent RAM-only loop) and informs performance-sensitive driver design.
Mechanically speaking
A typical layout splits buses by speed need: a fast bus serving the CPU core and RAM directly, and one or more slower peripheral buses serving UART/timers/GPIO, since most peripherals do not need (or cannot physically run at) the CPU's full core clock speed.
Shows up in
- Performance-sensitive register access
- Chip architecture understanding
- Explaining unusual timing behavior
Try it
The numbers are illustrative, but the real pattern holds: a tight loop polling a peripheral register is usually slower per-access than an equivalent RAM-only loop.
Try it: a mixed loop that touches both RAM and a peripheral register
Reading a slow peripheral register once and reusing (caching) the value in RAM-speed cached_status avoids paying the peripheral-bus cost on every loop iteration.
Check yourself
1. Why do many chips use a separate, slower bus for peripherals instead of running everything at the CPU's full core speed?
Splitting buses by speed matches each part of the chip to what it actually needs, since peripherals are typically far slower devices than the CPU core and its RAM.