IT lexicon › Hardware › Bit-banding

Bit-banding

Hardware På svenska → Updated: 2026-11-03

A Cortex-M3/M4 feature that maps every single bit of a memory region onto its own 32-bit word, so one bit can be set with a single atomic store.

Changing one bit in a register normally takes three steps: read, mask, write back. If an interrupt sneaks in between and touches the same register, one of the changes is lost. Bit-banding fixes this in the address decoder. The first megabyte of SRAM (from 0x20000000) and of peripheral space (from 0x40000000) each get an alias region, where the address alias_base + byte_offset·32 + bit·4 corresponds to exactly one bit. Write a 1 there and the bit is set; the bus handles the rest atomically.

It belongs to ARM history rather than ARM's future. It was optional on the M3 and M4, absent on the M0 and M7, and dropped entirely in ARMv8-M. Vendors now solve the same problem with dedicated set and clear registers — less elegant, but they don't eat 32 MB of address space.

← Back to the lexicon