Audio Synthesizer
Demo
Overview
The PIC18 Audio Synthesizer is a microcontroller-based waveform generator built using the PIC18F47Q84 from Microchip. It produces sine, triangle, and square waveforms using the on-chip DAC, and allows dynamic adjustment of waveform type and output frequency through an ADC-controlled potentiometer and pushbutton interface.
This project served as an introduction to the PIC18 architecture and low-level embedded signal generation, combining analog electronics, timer peripherals, and digital logic to synthesize audio in real-time on custom hardware.
Hardware
Implemented on a custom-soldered PIC18F47Q84 development board featuring a DAC output stage, potentiometer input, pushbutton interface, and audio output circuit. A voltage follower op-amp stage buffers the DAC output to drive a small speaker. Project is still in testing — final PCB schematic not yet complete.
- Core MCU: Microchip PIC18F47Q84 with internal DAC and ADC peripherals.
- Output Stage: Op-amp voltage follower for audio output to speaker.
- Input Controls: Potentiometer (ADC) for frequency control, button for waveform selection.
- Power: 3V from batteries or bench power supply.
Software
- Waveform synthesis using lookup tables (LUTs) for sine, triangle, and square waves.
- Timer interrupts control DAC waveform frequency precisely in response to ADC input.
- Button interrupts toggle waveform modes without blocking the main control loop.
- Lookup tables generated via Python scripts.
Results
The synthesizer successfully generated smooth and stable waveforms on the DAC output. Square wave produced the clearest and loudest audio due to higher energy at fundamental frequencies, while sine and triangle waves demonstrated accurate shape reproduction. Potentiometer provided seamless octave range control and waveform switching was immediate and glitch-free.
Future Work
- Upgrade to a higher-current output amplifier.
- Add digital computer control via MCP2221A USB bridge.
- Make wall-power compatible with a voltage regulator.
- Create a custom PCB to complete as a finished product.
Code
Current build available on GitHub. Custom PCB version in progress.