Skip to content

Search

Search courses, labs, notes, tools…

Guided lab · ECE 2

Microcontroller DAC: PWM, RC filter and DDS

Make an analog sine wave from a pin that can only be 0 or 5 V

Time
45 min
Bench
Emona kit bench

Free. The lab opens after Google sign-in, which also keeps your progress.

Screenshot of the "Microcontroller DAC: PWM, RC filter and DDS" virtual lab running on the Emona kit bench, wired and measuring

What you do in this lab

A real Arduino Uno program (running instruction by instruction on an emulated ATmega328P) drives a 62.5 kHz PWM pin. You will measure the carrier, filter it with an RC low-pass to get a 250 Hz sine (a "PWM DAC"), see what the filter corner does to the ripple and the amplitude, then write your own DDS generator in MicroPython on a Raspberry Pi Pico.

Objectives

  • Explain how a PWM signal and a low-pass filter make a DAC: the filter keeps the average (duty × Vdd).
  • Calculate the PWM frequency from the clock and the counter TOP: f = f_clk / (N·(TOP+1)).
  • Choose an RC corner between the signal and the carrier, and predict ripple and attenuation.
  • Build a DDS (direct digital synthesis) sine generator with a phase accumulator and a table.

Inside the lab

Step-by-step instructions with wiring checks, the readings you should get, questions with model answers and a short quiz. Sign in to open it.

Unofficial, free student project. Not affiliated with Emona Instruments or with any university. Emona and ETT-101 are trademarks of their owner.