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.

Bottom lineHow internal buses connect the CPU core to memory and peripherals at different speeds.

Breaking it down

A simplified multi-bus chip layoutCPU core — fastest accessFast bus — connects CPU to RAM and flashSlower peripheral bus(es) — connects to GPIO, timers, UART, etc.
A simplified multi-bus chip layout

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

Counting loop iterations at two simulated "costs" to show why bus speed mattersC: edit and run

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

Estimating total cycles for a loop that reads RAM every iteration but a register only onceC: edit and run

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?