Skip to the content
2 layersMain boardv2, the printed circuit board in 3D

Embedded Lab Final Project (UT ECE445L)

Copper layers
2
Thickness
1.6 mm
Parts
123
Nets
113
Pads
419
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 9.0 (file 20241229)
Created
3 Mar 2026
Updated
15 Sep 2026

Overview

Main boardv2 is an open-source printed circuit board by tguyenn, from the tguyenn/digital-synthesizer repository on GitHub. It is a 2-layer board with 123 parts on 113 nets.

It is built around the RP2040, LM321LVIDBVR-TP and AT25FF161A-SHN-B, with the SN74LV1T34DBVR-TP, TPD3E001DRLR and ABM8-272-T3 among its other parts. Its parts include 31 capacitors, 28 resistors, 16 connectors, 8 ICs and 8 diodes. It belongs with the RP2040 boards of this library.

Main components

6

README

README.md

Imagiano | Digital Synthesizer Project

$$\color{#CC5500} \text{UT ECE445L Competition Project}$$

Brought to you by...
@jeffchang0
@MorrisYLin
@zaarabilal
@tguyenn

Introduction

We decided to build a digital synthesizer/piano for our final project in UT Austin's Embedded Lab Class! We thought a piano was a great idea since we all love music, and a digital synthesizer presented a good deal of electrical, mechanical, and programming challenges.

Our digital piano consists of
1.) A main controller board
2.) A series of peripheral boards
3.) Piano keys with magnets
4.) Piano enclosure

... all from scratch!

Here's a clip of our project (Rev A) in action, credit to @jeffchang0:

[!IMPORTANT] Please enable audio and applaud the mouthcamerawork for the full demonstration!

Table of Contents

  1. System Design
  2. Electrical Design
  3. Mechanical Design
  4. Firmware Design
  5. Implementation Challenges
  6. Rev A Credits
  7. Rev B Motivation and Features

System Design

Figuring out requirements is by far the most important part of a project! Of course you have to know what you are building before you build it :)

We knew we wanted to make a piano of a larger scale, so we had to figure out how to seamlessly connect a lot of keys together.

After some thinking and debate, we came down to this diagram for our overall system design:

We opted to have a main controller board daisy-chained with a series of peripheral boards. This main board would also be connected to user interfaces like an LCD, digital rotary encoders, and an addressable LED strip.

system plan diagram
System Plan Diagram
Each peripheral board would have an array of linear Hall effect sensors to determine key position, with 12 of these sensors to form an octave. 5 of these peripheral boards allowed us to cover a good range of pitches!
periph board diagram
Peripheral Board Plan Diagram

To give some insight into what this came to be, here is a picture of our daisy-chained peripheral boards (sharpie for scale):

long pcb
Extra Extra Long PCB

Electrical Design

Once we had planned out the high-level details of the project, it was time to figure out what electrical connections needed to be made. First, it was time to go window shopping and datasheet diving on Mouser to figure out what we were even working with.

Once we had picked out all our parts, we drew out the schematic (and all of the relevant subsheets):

Main Schematic Rev APeriph Schematic Rev A
Rev A - Main (Left) and Peripheral (Right) Schematics

After verifying the schematic, we moved onto laying out the PCB itself:

FrontBack
Rev A - Front and back main board
FrontBack
Rev A - Front and back peripheral board

Design Choices

Why did you choose Texas Instrument's MSPM0G3507 MCU?
  • Since this was a class project, we were required to use this particular MCU.
Why did you use an MSPM0G3507 launchpad/devkit instead of having two discrete MCUs?
  • Since this was a class project, we were required to have a fallback plan in case our discrete MCU did not work for any reason.
Why did you choose I2C over SPI for the wired peripheral board bus?
  • At first we were going to go with an SPI bus connected as a "star topology" vs daisy-chained. We ultimately went with I2C to reduce the amount of GPIO usage and wires (i.e. SPI CS line for every peripheral board -> just the I2C SDA & SCL). We did consider the possible issue of bus capacitance since our bus would be almost a meter long (!!), but we just accepted our fate (reduce I2C speed if necessary).
Why is there an LDO on every peripheral board?
  • Instead of routing 3V3 all across each peripheral board, we opted to route 5V and have local 3V3 LDOs. This removed any possibility of power supply noise within our sensitive analog Hall sensors.
Why do we have LEDs on the analog mux select lines?
  • For fun! It's also nice to have a visual indicator when debugging (i.e. which sensor index is being sampled right at this moment when I pause?)
Why did you use a mix of through hole components (LDO, capacitors) or other non-ideal components (speaker amp)?
  • Since this was a class project, we were restricted to a very stringent budget ($60!) for the entire project. The through hole components and speaker amp were considered "free" since we could get them from a university equipment desk.
Why did you use funny protoboards as connectors instead of using right angle connectors?
  • Same thing as above. Right angle connectors would be the way to go, but the budget limitations said otherwise.
Why did you choose a 2 layer PCB?
  • 4 layers would be overkill for this project since board density wasn't crazy. This was also a school project, so we didn't need to worry about EMC regulations (RIP ground plane) and had to worry more about the budget.
What happened for your speaker output circuit?
  • At the last minute (literally like an hour before designs were due) we realized our original amp design could potentially not work (slipped through team and TA design review), so we slapped on a backup circuit (simple voltage buffer) on the other side. The particular issue was our questionable adaptation of a (free!) differential amplifier for a single ended application.

Mechanical Design

TODO: @jeffchang0 cad models pictures?

TODO: @jeffchang0 mechanical design challenges

TODO: talk about mass manufacturing of keys - shoutout "tiw"

Firmware Design

Rev A firmware lives in firmware/firmware_v1 and runs on the MSPM0G3507 (LaunchPad fallback or the onboard MCU). Competition rules banned TI SysConfig, so every module we used was brought up by poking registers from the datasheet and TRM. We still leaned on Valvano's class library (inc/) for Clock, LaunchPad GPIO, I2C, timers, and the ST7735 LCD, then wrote our own drivers in lib/ for the piano-specific hardware.

The production main is deliberately tiny: clock + LaunchPad init, DAC + 32 kHz DMA audio, Hall-sensor ADC, then a forever loop that only fills audio buffers. LCD/encoder and LED-strip code exists, but DSP ate so much CPU that we could not keep those loops running in the shipped demo (see Implementation Challenges).

Coding habits that showed up everywhere:

  • Bare metal, no RTOS. Time-critical work is ISRs + DMA; the foreground loop is just "refill the buffer the DMA just finished."
  • Mailboxes / flags between ISRs and main (key attack/release actions, ping-pong refill bits, encoder "redraw me" flags) instead of doing DSP inside interrupts.
  • Fixed-point everywhere in the audio path. Frequencies become 32-bit DDS tuning words at compile time; samples, envelopes, and gains are int16/int32 with shifts. No floating point on the Cortex-M0+ hot path.
  • BoardConfig.h as a compile-time switch between LaunchPad pinout and the discrete MCU pinout, so we could keep one codebase for both boards.

MSPM0 modules we actually used: GPIO (mux select, encoders, heartbeat), I2C1 (peripheral ADCs), TIMA1 (key scan), TIMG0 (audio sample clock / event publisher), DAC12 (speaker), DMA (audio to DAC, and separately LED PWM), TIMG7 + PWM (WS2812B), and GROUP1 GPIO interrupts (encoders).

ADC Sampling

Each peripheral board has a 16:1 analog mux in front of an I2C ADC (addresses 0x48, 0x49, 0x4A, 0x4C, 0x4D for the five octaves). Only 12 mux channels are wired (one key each); the extra four are unused. Four GPIOB bits (PB20, PB24, PB4, PB3 on the LaunchPad profile) are the mux select lines, which also drive those debug LEDs on the schematic.

TimerA1 fires at 1800 Hz and the ISR samples one key per tick over I2C (I2C_Recv2), then advances the mux. A full 60-key sweep is therefore 30 Hz. That is slow for audio-rate velocity, but it was enough to catch a press vs a rest without blocking the synth.

Because neighboring key magnets had to alternate polarity, even keys treat an ADC rise as "down" and odd keys invert it. Rest is calibrated around 1.7 V (~2110 counts on a 12-bit, 3.3 V full scale). A note attacks only if displacement is past a hysteresis threshold and velocity (delta displacement) is above a noise floor; it releases when the key comes back under the release threshold. The ISR only posts Attack_Key / Release_Key into a mailbox. The synth thread is the one that actually starts/stops oscillators, so we do not re-enter the wavetable from I2C context.

DSP

Audio is a 32 kHz, 12-bit two's-complement stream out of DAC12 on PA15. TimerG0 is programmed as a 32 kHz down-counter that publishes a zero-event onto Event Route 1. DMA channel 0 is a circular, repeat-single transfer from a 512-sample ping-pong buffer (256 + 256) into DAC0->DATA0. Half-done and done IRQs set refillPing / refillPong; Synth_Write_Buf() in main fills whichever half just retired.

The voice engine is additive DDS over 60 keys (C2–B6):

  • Each key has a 32-bit phase accumulator. The increment is freq * 2^32 / 32000, baked into a table with PHASE_INC().
  • The top 10 bits index a 1024-entry wavetable (PianoLUT). There is also a sine LUT in the tree; piano was what we shipped.
  • Amplitude is Note_Gain[key] (a little extra attenuation on the high notes) times a decaying envelope LUT (625 steps, advanced every 1024 samples). When the envelope runs out, the key is marked inactive.
  • Active keys are mixed, divided by 4, then hard-clipped to the DAC's signed 12-bit range (-2048…2047).

Polyphony is "all 60 if you mash them," which is exactly why the M0+ had nothing left for the UI.

LCD/Encoders

We wrote a GPIO interrupt driver for two mechanical encoders and a small ST7735 UI on top of Valvano's ST7735 driver.

  • Encoder 1 (PB15 CLK, PB16 DT, PB13 switch) walks a four-item instrument menu (Piano / Trumpet / Flute / Oboe) and the pushbutton toggles between the list and a "you selected X" screen.
  • Encoder 2 (PB19 CLK, PB2 DT) was meant to be volume, clamped 0–20.
  • Debounce is a short busy-wait in GROUP1_IRQHandler, then a re-read of the pin. The ISR only sets update_menu / update_screen_type; the commented-out main2 in Main.c is the foreground that would have redrawn.

That UI never made it into the competition binary. The synth loop could not share the CPU, so instrument select and volume stayed as unused (but working-in-isolation) drivers.

LED Strip

  • WS2812B LED Strip off of Amazon
  • One LED per key (60), GRB serialized into a 1440-word duty-cycle buffer.
  • We used PWM via the TimerG7 and the DMA controller to create the data stream for the finicky LED strip protocol.
    1. Defined the period the PWM waveform to be 1.25 µs and adjusted the duty cycle to transmit a 0 or 1
    2. TimerG7 configured to publish a Generic Event 0 to Event Channel 1 every time the counter reached its reload point
    3. The DMA controller subscribed to this channel executed a Repeat Single Transfer upon each trigger to move a duty cycle value from a buffer into the TimerG7 CC01 register

Implementation Challenges

  • There were a few small (but important!) details that slipped through PCB design review, namely
    • Pinout for onboard MSPM0 MCU footprint was flipped on one rail, so many pins had to be bluewired for the onboard MCU to work
    • Pinout for dc barrel jack was also wrong (ground plane became a 5V plane), so had to desolder and use a flying screw terminal setup
    • Pulled reset pin to the wrong polarity (nReset to ground), so we had to cut the trace and let the internal pullup do its thing
  • Jumper pains
    • During testing, we could not get the I2C module to output from our MSPM0 devkit pins. This was especially unfortunate and took us two hours to realize we had to remove some configuration jumpers on the devkit.
  • Magnets in the keys
    • We initially tried putting all the key magnets facing the same direction, but they kept interfering with each other (pressing one key also pressed adjacent keys)
    • We had to alternate the magnet polarity and fix in software (linear Hall sensors output voltage swinging in the opposite direction)
  • DSP calculations took so much CPU time that no other peripherals besides ADC sampling worked
    • Had to reduce scope of project (removed user interface) to meet the deadline with a working product
  • Competition restricted us to writing everything without using TI's beloved SysConfig, so we had to figure out some module initializations by ourselves using the datasheet + TRM
  • BOM management
    • Sticking to the $60 budget for the entire project was tricky, and we had to cut corners wherever possible

Rev A Credits

@jeffchang0 - Mechanical design/fabrication
@MorrisYLin - DAC driver/firmware, DSP firmware, PCB design/validation
@zaarabilal - I2C ADC driver/firmware, LCD/digital encoder drivers/firmware, Mechanical design
@tguyenn - PCB design/validation/assembly, WS2812B LED driver/firmware, Documentation

Rev B Motivation and Features

Due to time and budget restrictions, we weren't able to cleanly implement all of our features. We didn't like that, so we decided to spin a new revision of the main board to add and fix some features.

Some of these features include:

  • Replaced MSPM0G3507 with dual core microcontroller (RP2040) to properly handle the math compute load, sound output, LED strip output, and user interface
    • Dual-core instead of two discrete MCUs because flashing twice and maintaining two codebases is annoying
  • 4 layer PCB
  • Removed backpack devkit
    • Escape potential jumper hell
  • Cleaned audio output circuit
  • Replaced all through-hole with SMD components
  • Replace main board LDO with switching regulator for fun
  • Black soldermask + ENIG PCBs
  • Silkscreen art!
  • added ESD protection ???
Main Schematic Rev BPeriph Schematic Rev B
Rev B - Main (Left) and Peripheral (Right) Schematics

After verifying the schematic, we moved onto laying out the PCB itself:

FrontBack
Rev B - Front and back main board
FrontBack
Rev B - Front and back peripheral board

coming soon...™️

Rev B Electrical Design

Rev B Credits

Parts

123
QtyValueFootprintReferences
140u1Capacitor_SMD:C_0603_1608MetricC202, C304, C305, C307, C309, C310, C311, C312, C313, C314, C507, C601, C602, C801
710kResistor_SMD:R_0603_1608MetricR303, R307, R308, R601, R602, R603, R604
71uCapacitor_SMD:C_0603_1608MetricC303, C306, C308, C503, C504, C701, C702
7470Resistor_SMD:R_0603_1608MetricR202, R301, R302, R401, R402, R403, R404
427Resistor_SMD:R_0603_1608MetricR305, R306, R801, R802
42x5 Socket PinsSamacSys_Parts:logic_analyzer_slot_2x5_2.54mmJ402, J503, J601, J701
4MountingHoleSamacSys_Parts:standoff_MHH101, H102, H103, H104
4NX3020NAK-QRSamacSys_Parts:SOT95P230X110-3NQ401, Q402, Q403, Q404
310uCapacitor_SMD:C_0603_1608MetricC203, C204, C802
3GNDSamacSys_Parts:bettertestpoint2TP201, TP701, TP803
3Jumper_2_Small_BridgedJumper:SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mmJP201, JP202, JP301
3Jumper_2_Small_OpenJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP501, JP502, JP503
210nCapacitor_SMD:C_0603_1608MetricC501, C502
215pCapacitor_SMD:C_0603_1608MetricC301, C302
23u3Capacitor_SMD:C_0603_1608MetricC505, C506
247kResistor_SMD:R_0603_1608MetricR503, R504
25k1Resistor_SMD:R_0603_1608MetricR203, R204
2787Resistor_SMD:R_0603_1608MetricR501, R502
2Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ203, J206
2Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ501, J801
2LM321LVIDBVRSamacSys_Parts:SOT95P280X145-5NIC501, IC502
2RUN_LEDSamacSys_Parts:LEDC2012X40NLED301, LED302
2RotaryEncoder_SwitchRotary_Encoder:RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-SxxxxSW601, SW602
2SWD BreakoutConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ202, J205
11kResistor_SMD:R_0603_1608MetricR304
11k5Resistor_SMD:R_0603_1608MetricR201
11x8 Male PinsConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ401
122k1Resistor_SMD:R_0603_1608MetricR206
12u2Capacitor_SMD:C_0603_1608MetricC201
13V3_PWRSamacSys_Parts:LEDC2012X40NLED202
151kResistor_SMD:R_0603_1608MetricR205
15V_PWRSamacSys_Parts:LEDC2012X40NLED201
18u2Inductor_SMD:L_Abracon_ASPI-4030SL201
1ABM8-272-T3Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY301
1AP64060TQWU-7SamacSys_Parts:SOT95P280X100-6NIC201
1AT25FF161A-SHN-BSamacSys_Parts:SOIC127P798X216-8NIC301
1Barrel_JackSamacSys_Parts:373J204
1DAC_LSamacSys_Parts:bettertestpoint2TP501
1DAC_RSamacSys_Parts:bettertestpoint2TP502
1DOUT3V3SamacSys_Parts:bettertestpoint2TP801
1DOUT5VSamacSys_Parts:bettertestpoint2TP802
1HiLetGo_ST7735R445L:hiletgo_st7735rJ702
1Jumper_2_Small_BridgedJumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mmJP801
1PCM1780DBQRSamacSys_Parts:SOP64P600X175-16NIC503
1RSamacSys_Parts:bettertestpoint2TP504
1RP2040SamacSys_Parts:SC091413U301
1SSamacSys_Parts:bettertestpoint2TP503
1S0SamacSys_Parts:LEDC2012X40NLED401
1S1SamacSys_Parts:LEDC2012X40NLED402
1S2SamacSys_Parts:LEDC2012X40NLED403
1S3SamacSys_Parts:LEDC2012X40NLED404
1SN74LV1T34DBVRSamacSys_Parts:SOT95P280X145-5NIC801
1SWD BreakoutConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ301
1TSamacSys_Parts:bettertestpoint2TP505
1TPD3E001DRLRSamacSys_Parts:SOTFL50P160X60-5NIC202
1USBVSamacSys_Parts:bettertestpoint2TP202
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ201
1VBUSSamacSys_Parts:bettertestpoint2TP203
1XTAL_REFSamacSys_Parts:bettertestpoint2TP301
1trs_audio_jack445L:Jack_3.5mm_CUI_SJ1-3523N_HorizontalJ502

More from tguyenn/digital-synthesizer

2
  • 2 layers115 × 75 mmMain boardv1, the printed circuit board in 3D

    Main boardv1

    tguyenn/digital-synthesizer

    Embedded Lab Final Project (UT ECE445L)

    101 parts
  • 2 layers160.6 × 28 mmPeriph boardv2, the printed circuit board in 3D

    Periph boardv2

    tguyenn/digital-synthesizer

    Embedded Lab Final Project (UT ECE445L)

    87 parts

Similar boards

  • 4 layers140 × 140 mmPCU, the printed circuit board in 3D

    PCU

    Andresse2020/NovaDrone-Hardware

    Complete electronic system design for a high-performance quadcopter drone, developed entirely from scratch. Includes power distribution, motor control, flight stabilization, sensor integration, and communication…

    760 parts3
  • 4 layers83 × 55 mmSADA Board, the printed circuit board in 3D

    SADA Board

    makerCL/JUCI_CubeSat_SADA

    Solar Array Drive Assembly

    160 parts2
  • 2 layers46.7 × 87.5 mmServo motor, the printed circuit board in 3D

    Servo motor

    tomrodinger/servomotor

    Open-source NEMA-17 integrated servomotor (motor + closed-loop driver + controller + encoder). RS-485, Python/Arduino libraries, MCP server for AI control. Hardware, firmware and software.

    112 parts17MIT
  • 2 layers255.8 × 122.5 mmSplitfox, the printed circuit board in 3D

    Splitfox

    speedypotato/SplitFox-Pro

    Split-style Pro Leverless Controller

    143 parts6
  • 4 layers160 × 73.2 mmMainPCB, the printed circuit board in 3D

    MainPCB

    doppelgrau/esp32-f9p-io-board

    An IO-PCB (two motor-driver/H-bridge, CAN, RS232, ADS1115, relay, ethernet, ardusimple f9p compatible connector) with an ESP32 for 12V power, three 15V tolerant analog inputs, three 5V tolerant inputs.

    162 parts39
  • 4 layers536.5 × 385.7 mmDC27-badge, the printed circuit board in 3D

    DC27-badge

    netik/dc27_badge

    Defcon 27 "DaBomb!" badge.

    141 parts30Apache-2.0
  • 2 layers50 × 50 mmLED MCU, the printed circuit board in 3D

    LED MCU

    joemadeus/electronica

    A collection of circuits and similar

    88 parts1
  • 2 layers60 × 30 mmHt peep hardware, the printed circuit board in 3D

    Ht peep hardware

    anarchyincubator/ht_peep_hw

    kicad for peep hw platform

    36 parts

Questions

What parts does the Main boardv2 use?

123 parts, built around the RP2040, LM321LVIDBVR-TP, AT25FF161A-SHN-B and SN74LV1T34DBVR-TP. 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 Main boardv2 KiCad files?

From the tguyenn/digital-synthesizer repository on GitHub, at the commit this page was made from: the board is hardware/main_boardv2/main_boardv2.kicad_pcb and its schematic hardware/main_boardv1/AUDIO_IO.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Main boardv2 design in my own project?

Its repository states no licence, so its author keeps all rights: ask tguyenn before reusing the design.