Key specifications
The firmware runs from internal flash and executes entirely from zero-wait-state memory, keeping latency low even while updating the OLED display.
Clock configuration
- Internal 8 MHz oscillator feeds the Digital Frequency Locked Loop (DFLL).
- DFLL multiplies to 48 MHz for the CPU and synchronous peripherals.
- The generic clock controller divides the 48 MHz clock for:
- 1 MHz I²C (SERCOM3) used by EEPROM and OLED
- 2 MHz SERCOM1 for the touch controller SPI
- 32 kHz reference for millisecond timing (via
SysTick)
Peripheral mapping
The
PORT multiplexer assigns each SERCOM to specific pins; see the KiCad design for exact pad numbers.
Memory layout
- Bootloader (8 KB) – UF2-compatible loader for factory flashing and community updates.
- Application (240 KB max) – ZeroKeyUSB firmware; currently uses <30% of available flash.
- EEPROM emulation is unused; all persistent data lives in the external M24C64-W.
- SRAM buffers:
- 512 bytes for OLED frame buffer
- 128 bytes for USB HID reports
- 96 bytes scratch space for AES blocks
Power and sleep
- The MCU runs in active mode while connected; consumption stays below 25 mA for the whole board.
- After 60 seconds of inactivity the firmware dims the OLED and places the CPU into Standby while keeping USB active.
- Touch or USB activity wakes the chip in under 3 ms.
Firmware responsibilities
- Authenticating the Master PIN using AES routines.
- Orchestrating the menu, display, and touch interactions.
- Managing EEPROM read/write operations with wear-level tracking.
- Generating USB HID reports and processing CDC commands.
- Calculating TOTP codes using integer arithmetic (no floating point required).