Register Bitfield Decoder
Paste a register value and a field layout to get a decoded table — with presets for common STM32 and AVR registers.
Example: 0x00010023 decodes to CEN=1, DIR=0, CMS=1, ARPE=0, CKD=0, UIF=1.
Check it against real silicon
Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.
Formula
field = (register >> low) & ((1 << (high − low + 1)) − 1)Worked example
0x00010023 decodes to CEN=1, DIR=0, CMS=1, ARPE=0, CKD=0, UIF=1.
CEN = (reg >> 0) & 0x1
(0x00010023 >> 0) & 0x1
1
DIR = (reg >> 4) & 0x1
(0x00010023 >> 4) & 0x1
0
CMS = (reg >> 5) & 0x3
(0x00010023 >> 5) & 0x3
1
ARPE = (reg >> 7) & 0x1
(0x00010023 >> 7) & 0x1
0
Frequently asked questions
How do I extract a bitfield from a register?
Shift right by the field's low bit, then mask off the width: `(reg >> low) & ((1 << width) - 1)`. Doing the shift first avoids needing a mask positioned at the field's location.
Why do reserved bits matter?
Because most reference manuals require them to keep their reset value, and future silicon may give them meaning. Assigning a whole register clears them; read-modify-write preserves them. Peripherals that behave oddly after a config change are often a symptom of this.
Why does reading a register not return what I wrote?
Several reasons. Write-only bits read as zero. Clear-on-read flags change state when you look at them. Some fields are shadowed and only take effect on an update event. And some are only writable while the peripheral is disabled — the write silently does nothing otherwise.
Related tools
Bitwise Operation Calculator
AND, OR, XOR, NOT and shifts with a live bit grid so you can see exactly which bits moved.
Firmware
Hex, Binary & Decimal Converter
Convert between hex, binary, decimal, octal and ASCII, with width-aware bit grids and endianness swapping.
Firmware
Two's Complement Calculator
Signed and unsigned interpretation at any register width, with overflow and carry flags.
Firmware
Timer & Prescaler Calculator
Every valid prescaler and reload pair for a target frequency on AVR, STM32, PIC and RP2040 — ranked by error, with C you can paste.
Firmware
CRC Calculator
CRC-8, CRC-16 (CCITT, Modbus, XMODEM) and CRC-32 over hex or ASCII input, with the polynomial and shift steps explained.
Firmware
IEEE 754 Float Converter
Convert between decimal, hex and binary float32/float64, with the sign, exponent and mantissa fields broken out.
Firmware