Generating Sine, Square, Triangular, Sawtooth Waveform with Direct Digital Synthesizer method using PSoC 4 MCU and few passive components.

Ever drooled over Oscilloscope, Function Generator, Logic Analyzer but can’t afford those cool stuffs? Then, here is the good news! Build a fully functional decent Function Generator under 10$.

This project is about making a Direct Digital Synthesizer Function Generator that can sprout Sine, Square, Triangular, Saw waveforms. It’s also possible to program other random waveform patterns.

100 Hz - 20 kHz for Sine, Triangular, Sawtooth Wave
100 Hz - 50 kHz for Square Wave
Adjustable Gain Control
Adjustable Frequency Sweep
One press Frequency Stepping
One press Waveform Switching
Automatic HF Harmonic Filtering
Ground Offset Capability
Maximum 8 Bit DDS Resolution
Low Cost, maker friendly design
Minimum External Components
Programmable for Custom Waveform
Step 1: Working Principle
Direct digital synthesis (DDS) is a method of producing arbitrary waveform of any type using DAC.

The PSoC 4 has 2 internal IDACs or current DACs of 7 bit and 8 bit. For this device 8-bit IDAC is used because it provides better resolution.

To produce sine wave, there is a lookup table/array holding 256 value points of a full cycle sine wave. CPU reads those values and pass to IDAC to generate proportionate current. This current is drained through a resistor to generate corresponding voltage level. Finally that voltage is buffered through one of the internal Opamp to get the output signal.”