Ada Audits DAC and PWM Output Evidence

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
electronics
beginner
Ada ADA · CALCULATION AUDIT

Ada Audits DAC and PWM Output Evidence

An ESP32-style 8-bit DAC on a 3.3 V rail steps every 12.94 mV, a 12-bit DAC roughly 16 times finer, while a 75% PWM duty on 5 V averages to 3.75 V and a common 0.22 uF RC filter settles in about 11 ms. Code steps, duty fractions, and RC time constants are easy to blur into one story. This audit keeps each in its own lane and asks which physical limit — step size, duty average, or settling delay — each number actually belongs to.

Companion to the chapter DAC and PWM Output — every number here comes from that chapter.

A DAC code, a PWM duty cycle, and an RC filter all turn numbers into physical voltage. The audit is to keep the code range, reference voltage, duty fraction, and time constant separate until the final result.

1. DAC resolution is a voltage step, not just a bit label. For the ESP32-style 8-bit, 3.3 V example in this chapter, the endpoint code range is 0 through 255.

maximum code = 28 - 1 = 255; endpoint step = 3.3 V / 255 = 0.0129412 V = 12.94 mV
midscale example = 128 * (3.3 V / 255) = 1.65647 V, rounded at the end to 1.66 V

2. More bits shrink the voltage step exponentially. A 12-bit DAC has 4096 levels, so it is roughly 16 times finer than an 8-bit DAC over the same reference range.

12-bit endpoint step = 3.3 V / 4095 = 0.000805861 V = 0.805861 mV
level ratio = 4096 / 256 = 16; endpoint-step ratio = 12.94 mV / 0.805861 mV = 16.06
Check Arithmetic What it proves
75% PWM at 5 V 5 V * 0.75 = 3.75 V PWM average voltage follows duty fraction before any load or filter physics changes the waveform.
1 kHz period 1 / 1000 Hz = 0.001 s = 1 ms The switching period is much shorter than the filter settling time in the worked example.
100 Hz design capacitor 1 / (2 * pi * 10000 ohm * 100 Hz) = 0.000000159 F = 0.159 uF This is the calculated capacitor for a 100 Hz cutoff with a 10k ohm resistor.
Common 0.22 uF part 1 / (2 * pi * 10000 ohm * 0.22 uF) = 72.3 Hz The rounded component choice lowers the cutoff, improving smoothing while slowing response.
Settling time 5 * 10000 ohm * 0.22 uF = 0.011 s = 11 ms The filter needs about 11 ms to reach roughly 99% of a new target.

Audit rule: keep endpoint-code calculations, average-voltage calculations, and filter time-constant calculations in their own lanes. A clean design states which physical effect each number belongs to before comparing DAC and PWM options.

Every number above is taken from the chapter’s own material and re-derived step by step.