

AVR128DA48
Firmware for a portable DAP using a AVR128DA48 and VS1063 chip.
- Size
- 98 × 48 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 72
- Nets
- 99
- Pads
- 329
- Tracks, vias
- 427, 111
- Pours
- 19
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 28 Jan 2026
- Updated
- 30 Mar 2026
Overview
AVR128DA48 is an open-source printed circuit board by mjhagen, from the mjhagen/dap repository on GitHub. It is a 2-layer board of 98 × 48 mm with 72 parts on 99 nets, routed with 427 tracks and 111 vias.
It is built around the TPS7A2033PDBVR-TP, MAMK2520H2R2M and MAMK2520T4R7M. Its parts include 38 capacitors, 14 resistors, 6 ICs, 5 connectors and 3 switches.
Main components
3TPS7A2033PDBVR-TP
SOT-23-5-40℃~+85℃ 1 180uV@(300mA) 2uA 3.3V 300mA 5.5V 75dB@(1kHz) Fixed Over Current Protection、Enable、Thermal Shutdown Positive SOT-23-5 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSTECH PUBLICUncategorisedMAMK2520H2R2M
10082.2A 2.2uH 3.2A 90mΩ ±20% 1008 Power Inductors ROHSTaiyo YudenPower InductorsMAMK2520T4R7M
10081.3A 1.5A 260mΩ 4.7uH ±20% 1008 Power Inductors ROHSTaiyo YudenPower Inductors
README
README.mdAVR128DA48 Portable Audio Player Firmware
Firmware for a distraction‑free portable audio player built around AVR128DA48.

Scope
- VS1163A audio decoder (SPI)
- Project policy: firmware playback support is constrained to MP3, FLAC, and ALAC.
- microSD card with FAT filesystem (SPI)
- SSD1333 176×176 display (SPI)
- Buttons + rotary encoder (menu, playback, jog dial)
- Instant boot to playback screen
No networking. No background services. Boot fast, play audio.
Toolchain (macOS)
- VSCode + PlatformIO (editing, build, flash)
- MPLAB X IDE + MPLAB SIM (device simulator)
- XC8 (required by MPLAB tooling, not necessarily for builds)
Build & Flash
The primary development environment is curiosity_nano, which targets the Microchip Curiosity Nano board and uses UPDI for flashing.
pio run -e curiosity_nano
pio run -e curiosity_nano -t uploadAvailable environments:
curiosity_nano(Main Development) - Curiosity Nano target with UPDI uploadavr128da48- generic AVR128DA48 buildcuriosity_nano_ssd1333_minimal- controller smoke test for the SSD1333 panel
Current hardware baseline:
- microSD and SSD1333 share
SPI1onPC0..PC3(MOSI/MISO/SCK/CS) - VS1163A uses
PD5(XCS) andPD6(XDCS) for control chip-selects SPI0is reserved for VS1163A data/control traffic
Current microSD pin map:
PC0-> microSDDI/ breakoutMOSIPC1-> microSDDO/ breakoutMISOPC2-> microSDCLK/ breakoutSCKPC3-> microSDCS
Emulator / Simulator
- Build firmware with PlatformIO →
.elf - Open MPLAB X
- Select device:
AVR128DA48 - Debug tool: Simulator
- Load the
.elfand step through execution
Note: PlatformIO does not provide a simulator for AVR‑DA devices.
Project Structure
src/
main.c
board/ clocks, pin mapping
drivers/ spi, gpio, timers, ssd1333
display/ panel binding for the current 176x176 target
middleware/ sdcard, fatfs
app/ ui, input, playerFirmware Documentation
Detailed firmware documentation now lives in docs/firmware/.
Start there for architecture, runtime scheduling, UI behavior, driver boundaries, and build/debug notes.
Firmware SRAM Usage
Current SRAM map from the built ELF:
- .data: 1104 B at 0x804000 to 0x804450
- .bss: 10255 B at 0x804450 to 0x806C5F
- total static SRAM used: 11359 B / 16384 B (69.3%)
- remaining stack/runtime headroom: about 5025 B
- SRAM top: 0x808000
Largest SRAM consumers:
- player_rb: 4096 B
- dir_window: 1680 B
- dir_sort_index: 1280 B
- sd_fs_obj: 554 B
- s_flat_subdir_names: 512 B
- linebuf: 352 B
- scene: 277 B
- current_track: 262 B
- duration_job: 134 B
- LfnBuf: 130 B
- playback_full_path: 128 B
- last_footer_title: 128 B
- header_marquee_title: 96 B
- player_preload_rb: 1024 B
A few smaller but still relevant items:
- browse_row_cache_display_name: 64 B
- dir_scan_raw_indices: 48 B
- last_snapshot: 34 B
- toast_msg: 32 B
- sd_file_pool: 58 B
- art_refresh_path_hash: 4 B
- current_path_ref: 2 B
- playback_is_flat: 1 B
Browse limits and the 4096-byte player ring buffer were re-evaluated after the
structural SRAM cleanup and intentionally left unchanged. With about 4.9 KB of
remaining static headroom, further cuts would trade UI breadth or decoder margin
for little practical benefit.
Boot Sequence (target)
- Clock + GPIO init
- Display init (SSD1333 176×176)
- SD mount (timeout guarded)
- VS1163A init
- Start playback
- Enter UI loop
Non‑Goals
- No RTOS
- No dynamic allocation during playback
- No feature creep
VU Meter Findings
A dedicated boot-time probe was added to hammer vuMeter during playback, keep the timing statistics in RAM, and show the results on the OLED after a fixed capture window.
Measured on hardware over 10.001 s with fallback playback of Alabama Shakes - Sound & Color/02. Don't Wanna Fight.flac:
2406successful VU reads, about240 Hzaverage successful read rate- best observed valid-read spacing:
517 us, about1.9 kHz - best observed distinct VU-word change spacing:
1813 us, about552 Hz - average distinct VU-word change spacing on program material:
94.1 ms
Practical conclusion:
- VS1163A VU readback is not the limiting factor for
30 fpsor60 fpsmeters - OLED + SD contention on shared
SPI1is the real limiter for visual update rate - change-rate numbers from music are content-dependent because the VS VU result is quantized in
3 dBsteps
Development Log
✅ Complete
- Clock init: 24 MHz internal oscillator (OSCHF) on AVR-DA
- GPIO: Buttons (PD0), Encoder (PC0/PC1)
- MPLAB X integration: Simulator-based register inspection and boot-flow debugging
- SD card abstraction: SD card mount, file/directory listing (path-based API), file read/seek
- SD card driver: SPI-based driver for AVR-DA supporting SDHC/SDXC initialization
- FatFS integration: Full filesystem support for hardware with
FatFslibrary - Input handler: Cleaned up debounce and rotary encoder state machine
- File browser UI: Directory navigation with track numbering, alphabetical sorting, and scrolling
- VS1163A decoder: SPI control path (SCI), reset logic, and register configuration
- Status display: Persistent top bar with 5-segment battery graphic, playback status, and time remaining
- Miniature Font: Custom 3x5 pixel Geneva-style font for better legibility
- UI Navigation: Multi-level browsing with long-press support and playback path persistence
- 176 UI renderer: Scanline renderer for SSD1333 176×176 single-panel layout
🔄 In Progress
- Gapless Playback: Optimizing ISR-driven data pump to eliminate buffer underruns
📋 To Do
- Gapless Playback: implement a "next track" handover within the player_refill logic itself, avoiding the codec reset and feeding the transitions continuously into the ring buffer.
- Soft power off/on: implement a deep sleep mode as much as possible, at long press menu (>3s) switch off VS, amp.
- Add resistors to SD pins
Current State
Core playback engine and UI are functional on the SSD1333 176×176 single-panel hardware. Current focus is stable playback and responsive controls under real device load.
Parts
72| Qty | Value | Footprint | References |
|---|---|---|---|
| 16 | 100 nF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C1, C3, C13, C15, C16, C17, C18, C21, C22, C23, C25, C27, C29, C30, C32, C38 |
| 4 | 0kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R10, R14, R15, R16 |
| 4 | 1µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C2, C9, C31, C33 |
| 3 | 10 kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R2, R3, R4 |
| 3 | 10 µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C24, C28, C39 |
| 3 | 10µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C34, C35, C36 |
| 2 | 1 µF | Capacitor_SMD:C_2220_5750Metric_Pad1.97x5.40mm_HandSolder | C7, C8 |
| 2 | 18 pF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C19, C20 |
| 2 | 4.7µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C4, C5 |
| 2 | 470µF | Capacitor_SMD:CP_Elec_6.3x5.8 | C10, C12 |
| 1 | 0.1µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C26 |
| 1 | 1 µF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C14 |
| 1 | 100 kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R5 |
| 1 | 100nF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C6 |
| 1 | 100Ω | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R13 |
| 1 | 10µF | Capacitor_SMD:C_2220_5750Metric_Pad1.97x5.40mm_HandSolder | C11 |
| 1 | 12.288 MHz | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSoldering | Y2 |
| 1 | 20 kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R6 |
| 1 | 20kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R7 |
| 1 | 33 kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R8 |
| 1 | 330 Ω | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1 |
| 1 | 33kΩ | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R9 |
| 1 | AVR128DA48x-xPT | Package_QFP:TQFP-48_7x7mm_P0.5mm | U1 |
| 1 | Battery | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1 |
| 1 | Conn_02x10_Odd_Even | Connector_PinSocket_2.54mm:PinSocket_2x10_P2.54mm_Vertical | J2 |
| 1 | FerriteBead_Small | Inductor_SMD:L_0805_2012Metric_Pad1.05x1.20mm_HandSolder | FB1 |
| 1 | Headphones | Connector_Audio:SWITCHCRAFT_35RAPC3BH3 | J4 |
| 1 | MAMK2520H2R2M | MAMK2520H2R2M:INDC2520X120N | L1 |
| 1 | MAMK2520T4R7M | MAMK2520H2R2M:INDC2520X120N | L2 |
| 1 | MCP1603L | Package_TO_SOT_SMD:TSOT-23-5 | U5 |
| 1 | MEM2061-01-188-00-A_REVA | MEM2061-01-188-00-A_REVA:GCT_MEM2061-01-188-00-A_REVA | J3 |
| 1 | NetTie_2 | NetTie:NetTie-2_SMD_Pad2.0mm | NT1 |
| 1 | PLSJ-1 | Button_Switch_SMD:Knitter_PLSJ-1 | SW1 |
| 1 | Programming | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J5 |
| 1 | R_Potentiometer_Dual_MountingPin | Potentiometer_THT:Potentiometer_Alps_RK097_Dual_Horizontal | RV1 |
| 1 | SW_Push | Button_Switch_SMD:SW_Push_1P1T_NO_CK_KMR2 | SW3 |
| 1 | SW_Push | Button_Switch_SMD:SW_SPST_EVQP7A | SW2 |
| 1 | TPA6111A2DR | Package_SO:Texas_HTSOP-8-1EP_3.9x4.9mm_P1.27mm_EP2.95x4.9mm_Mask2.4x3.1mm_ThermalVias | U3 |
| 1 | TPS63001DRCT | Package_SON:Texas_DRC0010J_ThermalVias | U4 |
| 1 | TPS7A2033PDBVR | Package_TO_SOT_SMD:SOT-23-5 | U6 |
| 1 | VS1163A | Package_QFP:LQFP-48_7x7mm_P0.5mm | U2 |
More from mjhagen/dap
3- 2 layers98 × 48 mm

- 2 layers42.2 × 42.2 mm

- 2 layers37 × 24.5 mm

TPA6111A2-breakout
mjhagen/dap
Firmware for a portable DAP using a AVR128DA48 and VS1063 chip.
14 parts
Similar boards
- 2 layers135.5 × 93 mm

Spectrum display
nathaniel-fargo/audio-spectrum-vibes
A fun little display piece for vibing to the audio spectrum. Inspired by Apple's iOS media player 5 bar spectrum analyzer.
223 partsMIT - 2 layers120 × 85 mm

- 2 layers35 × 17 mm

- 2 layers80.7 × 38.5 mm

- 2 layers100 × 100 mm

Zxevo1010 main
UzixLS/zxevo1010-board
10x10cm PCB variant of ZX-Evolution project for G738/G706 enclosure
252 parts26 - 2 layers100 × 100 mm

Zxuno1010
UzixLS/zxuno1010-board
10x10cm PCB variant of ZX-UNO project for G738/G706 enclosure
233 parts23MIT - 2 layers91.3 × 57.5 mm

- 4 layers144 × 127 mm

Frothfet
hoeken/frothfet
Yarrboard load controller board with current sense, volt sense, fuses, and sender support.
394 parts14GPL-3.0
Questions
How big is the AVR128DA48 PCB?
It measures 98 × 48 mm and has 2 copper layers, 1.6 mm thick.
What parts does the AVR128DA48 use?
72 parts, built around the TPS7A2033PDBVR-TP, MAMK2520H2R2M and MAMK2520T4R7M. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the AVR128DA48 KiCad files?
From the mjhagen/dap repository on GitHub, at the commit this page was made from: the board is Hardware-v2/AVR128DA48.kicad_pcb and its schematic AVR128DA48/AVR128DA48.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the AVR128DA48 design in my own project?
Its repository states no licence, so its author keeps all rights: ask mjhagen before reusing the design.