

Main boardv2
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
6RP2040
LQFN-56(7x7)12bit 133MHz 30 LQFN-56(7x7) Microcontrollers (MCU/MPU/SOC) ROHSRaspberry PiMicrocontrollers (MCU/MPU/SOC)LM321LVIDBVR-TP
SOT-23-5-40℃~+125℃ 1 10pA 10pA 1MHz 2.2V~5.5V 20mA 20nV/√Hz@10kHz 2uV/℃ 40uA 500uV 600V/ms 80dB Rail-to-Rail Input, Rail-to-Rail Output SOT-23-5 Operational Amplifier ROHSTECH PUBLICOperational AmplifierAT25FF161A-SHN-B
SOIC-8-208mil-40℃~+85℃ 1.65V~3.6V 16Mbit SPI SOIC-8-208mil NOR FLASH ROHSRenesas ElectronicsNOR FLASHSN74LV1T34DBVR-TP
SOT-23-5-40℃~+125℃ 1 1 1.6V~5.5V CMOS CMOS Power-off protection Unidirectional SOT-23-5 Translators, Level Shifters ROHSTECH PUBLICTranslators, Level ShiftersTPD3E001DRLR
SOT(5x3)-40℃~+85℃ 1.5pF 11V 1nA 5.5A@8/20us 5.5V 90W ESD IEC 61000-4-2 Three channels Unidirectional SOT(5x3) ESD and Surge Protection (TVS/ESD) ROHSTexas InstrumentsESD And Surge Protection (TVS/ESD)ABM8-272-T3
SMD3225-4P-40℃~+85℃ 10pF 12MHz 50Ω SMD crystal oscillator ±30ppm ±30ppm SMD3225-4P Crystals ROHSAbraconCrystals
README
README.mdImagiano | 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
- System Design
- Electrical Design
- Mechanical Design
- Firmware Design
- Implementation Challenges
- Rev A Credits
- 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 |
![]() |
| 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):
![]() |
| 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):
![]() | ![]() |
| Rev A - Main (Left) and Peripheral (Right) Schematics | |
After verifying the schematic, we moved onto laying out the PCB itself:
![]() | ![]() |
| Rev A - Front and back main board | |
![]() | ![]() |
| 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/int32with shifts. No floating point on the Cortex-M0+ hot path. BoardConfig.has 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 withPHASE_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 (
PB15CLK,PB16DT,PB13switch) 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 (
PB19CLK,PB2DT) 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 setsupdate_menu/update_screen_type; the commented-outmain2inMain.cis 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.
- Defined the period the PWM waveform to be 1.25 µs and adjusted the duty cycle to transmit a
0or1 - TimerG7 configured to publish a
Generic Event 0toEvent Channel 1every time the counter reached its reload point - 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
- Defined the period the PWM waveform to be 1.25 µs and adjusted the duty cycle to transmit a
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 ???
![]() | ![]() |
| Rev B - Main (Left) and Peripheral (Right) Schematics | |
After verifying the schematic, we moved onto laying out the PCB itself:
![]() | ![]() |
| Rev B - Front and back main board | |
![]() | ![]() |
| Rev B - Front and back peripheral board | |
coming soon...™️
Rev B Electrical Design
Rev B Credits
Parts
123| Qty | Value | Footprint | References |
|---|---|---|---|
| 14 | 0u1 | Capacitor_SMD:C_0603_1608Metric | C202, C304, C305, C307, C309, C310, C311, C312, C313, C314, C507, C601, C602, C801 |
| 7 | 10k | Resistor_SMD:R_0603_1608Metric | R303, R307, R308, R601, R602, R603, R604 |
| 7 | 1u | Capacitor_SMD:C_0603_1608Metric | C303, C306, C308, C503, C504, C701, C702 |
| 7 | 470 | Resistor_SMD:R_0603_1608Metric | R202, R301, R302, R401, R402, R403, R404 |
| 4 | 27 | Resistor_SMD:R_0603_1608Metric | R305, R306, R801, R802 |
| 4 | 2x5 Socket Pins | SamacSys_Parts:logic_analyzer_slot_2x5_2.54mm | J402, J503, J601, J701 |
| 4 | MountingHole | SamacSys_Parts:standoff_MH | H101, H102, H103, H104 |
| 4 | NX3020NAK-QR | SamacSys_Parts:SOT95P230X110-3N | Q401, Q402, Q403, Q404 |
| 3 | 10u | Capacitor_SMD:C_0603_1608Metric | C203, C204, C802 |
| 3 | GND | SamacSys_Parts:bettertestpoint2 | TP201, TP701, TP803 |
| 3 | Jumper_2_Small_Bridged | Jumper:SolderJumper-2_P1.3mm_Bridged2Bar_RoundedPad1.0x1.5mm | JP201, JP202, JP301 |
| 3 | Jumper_2_Small_Open | Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP501, JP502, JP503 |
| 2 | 10n | Capacitor_SMD:C_0603_1608Metric | C501, C502 |
| 2 | 15p | Capacitor_SMD:C_0603_1608Metric | C301, C302 |
| 2 | 3u3 | Capacitor_SMD:C_0603_1608Metric | C505, C506 |
| 2 | 47k | Resistor_SMD:R_0603_1608Metric | R503, R504 |
| 2 | 5k1 | Resistor_SMD:R_0603_1608Metric | R203, R204 |
| 2 | 787 | Resistor_SMD:R_0603_1608Metric | R501, R502 |
| 2 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J203, J206 |
| 2 | Conn_01x03_Pin | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J501, J801 |
| 2 | LM321LVIDBVR | SamacSys_Parts:SOT95P280X145-5N | IC501, IC502 |
| 2 | RUN_LED | SamacSys_Parts:LEDC2012X40N | LED301, LED302 |
| 2 | RotaryEncoder_Switch | Rotary_Encoder:RotaryEncoder_Bourns_Vertical_PEC12R-3x17F-Sxxxx | SW601, SW602 |
| 2 | SWD Breakout | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J202, J205 |
| 1 | 1k | Resistor_SMD:R_0603_1608Metric | R304 |
| 1 | 1k5 | Resistor_SMD:R_0603_1608Metric | R201 |
| 1 | 1x8 Male Pins | Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical | J401 |
| 1 | 22k1 | Resistor_SMD:R_0603_1608Metric | R206 |
| 1 | 2u2 | Capacitor_SMD:C_0603_1608Metric | C201 |
| 1 | 3V3_PWR | SamacSys_Parts:LEDC2012X40N | LED202 |
| 1 | 51k | Resistor_SMD:R_0603_1608Metric | R205 |
| 1 | 5V_PWR | SamacSys_Parts:LEDC2012X40N | LED201 |
| 1 | 8u2 | Inductor_SMD:L_Abracon_ASPI-4030S | L201 |
| 1 | ABM8-272-T3 | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | Y301 |
| 1 | AP64060TQWU-7 | SamacSys_Parts:SOT95P280X100-6N | IC201 |
| 1 | AT25FF161A-SHN-B | SamacSys_Parts:SOIC127P798X216-8N | IC301 |
| 1 | Barrel_Jack | SamacSys_Parts:373 | J204 |
| 1 | DAC_L | SamacSys_Parts:bettertestpoint2 | TP501 |
| 1 | DAC_R | SamacSys_Parts:bettertestpoint2 | TP502 |
| 1 | DOUT3V3 | SamacSys_Parts:bettertestpoint2 | TP801 |
| 1 | DOUT5V | SamacSys_Parts:bettertestpoint2 | TP802 |
| 1 | HiLetGo_ST7735R | 445L:hiletgo_st7735r | J702 |
| 1 | Jumper_2_Small_Bridged | Jumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mm | JP801 |
| 1 | PCM1780DBQR | SamacSys_Parts:SOP64P600X175-16N | IC503 |
| 1 | R | SamacSys_Parts:bettertestpoint2 | TP504 |
| 1 | RP2040 | SamacSys_Parts:SC091413 | U301 |
| 1 | S | SamacSys_Parts:bettertestpoint2 | TP503 |
| 1 | S0 | SamacSys_Parts:LEDC2012X40N | LED401 |
| 1 | S1 | SamacSys_Parts:LEDC2012X40N | LED402 |
| 1 | S2 | SamacSys_Parts:LEDC2012X40N | LED403 |
| 1 | S3 | SamacSys_Parts:LEDC2012X40N | LED404 |
| 1 | SN74LV1T34DBVR | SamacSys_Parts:SOT95P280X145-5N | IC801 |
| 1 | SWD Breakout | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J301 |
| 1 | T | SamacSys_Parts:bettertestpoint2 | TP505 |
| 1 | TPD3E001DRLR | SamacSys_Parts:SOTFL50P160X60-5N | IC202 |
| 1 | USBV | SamacSys_Parts:bettertestpoint2 | TP202 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_Horizontal | J201 |
| 1 | VBUS | SamacSys_Parts:bettertestpoint2 | TP203 |
| 1 | XTAL_REF | SamacSys_Parts:bettertestpoint2 | TP301 |
| 1 | trs_audio_jack | 445L:Jack_3.5mm_CUI_SJ1-3523N_Horizontal | J502 |
More from tguyenn/digital-synthesizer
2- 2 layers115 × 75 mm

- 2 layers160.6 × 28 mm

Similar boards
- 4 layers140 × 140 mm

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 mm

- 2 layers46.7 × 87.5 mm

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 mm

- 4 layers160 × 73.2 mm

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 mm

- 2 layers50 × 50 mm

- 2 layers60 × 30 mm

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.














