A DAC directly produces a true analog voltage from a digital value, useful for generating smooth, fast-changing analog signals: audio output, arbitrary waveform generation, precise analog control voltages (e.g., a setpoint to an external analog circuit), or sensor excitation. PWM plus an RC low-pass filter is the poor-man's DAC: it averages a duty-cycle-modulated square wave into an analog level, which is cheap and uses a timer you already have, but it has tradeoffs, there's residual ripple at the PWM frequency, the RC filter limits how fast the output can change (bandwidth vs ripple tradeoff), and resolution trades against frequency. A real DAC gives a clean output that can change every sample with no filter-settling delay and no ripple, at the cost of needing the dedicated peripheral and usually an output buffer (op-amp) because the DAC pin can drive only a tiny current. So: use a true DAC when you need fast, clean analog (audio, waveforms); use PWM+RC when the signal is slow, you can tolerate ripple, and you want to save the DAC peripheral or the MCU lacks one. Both ultimately need attention to output drive strength for real loads.
Embedded Systems Fundamentals · Interview question
When would you use a DAC, and how does it differ from PWM?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
ADC & DAC
Bridging the analog and digital worlds: how an ADC quantizes a voltage to an N-bit count (and a DAC reverses it), the count↔voltage math, and why Vref and Nyquist set your limits.