Waveform Generator
Demo
Wave Generator Demo
Audio Synth Example
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 Digital-to-Analog Converter (DAC), and allows the user to dynamically adjust 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
The system was implemented on a custom-soldered PIC18F47Q84 development board featuring a DAC output stage, potentiometer input, pushbutton interface, and an audio output circuit. A simple voltage follower op-amp stage was used to buffer the DAC output and drive a small speaker to demonstrate the usability of the signal. Project is still in testing phase so final formal circuit schema is not complete yet.
- Core MCU: Microchip PIC18F47Q84 with internal DAC and ADC peripherals.
- Output Stage: Op-amp configured as voltage follower for audio output to speaker.
- Input Controls: Potentiometer (ADC input) for frequency control and button for waveform selection.
- Power: Raw poweered with 3 Volt's from batteries/power supply.
Software
- Implemented waveform synthesis using lookup tables (LUTs) for sine, triangle, and square waves.
- Configured timer interrupts to precisely control DAC waveform frequency in response to ADC input.
- Button interrupts used to toggle between waveform modes efficiently without blocking the main control loop.
- Lookup tables generated via Python scripts.
Results
The final synthesizer successfully generated smooth and stable waveforms on the DAC output. The square wave produced the clearest and loudest audio output due to higher energy at fundamental frequencies, while sine and triangle waves demonstrated accurate shape reproduction but lower amplitude due to output stage current limitations.
The potentiometer provided seamless control over the octave range, and waveform switching was immediate and glitch-free. The full hardware demo is shown in the linked video below.
Project Code / Report
Project is not complete want to make custom PCB with plug in power using a regulator, high current output operational amplifier for DAC output and a MCP2221A I have been playing with to enable computer control of the generator. However current build is available in Github.
Future Work
- Upgrade output amplifier to a higher-current current.
- Add digital control.
- Make plugginable to wall power.
- Create custom PCB to complete as a product.