PWM-to-DAC Selection Calculation Audit
PWM-to-DAC Selection Calculation Audit
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
PWM-to-DAC Selection Calculation Audit
An 8-bit PWM at code 200 on a 3.3 V rail averages to 2.59 V, but a fixed 10.24 MHz timer that gives 40 kHz at 8 bits drops to 2.5 kHz at 12 bits, and a 20 kHz PWM through a 0.22 uF RC filter trades ripple for an 11 ms settling delay. Reaching for a DAC instead swaps the switching carrier for quantization steps. This audit re-derives each figure and asks which limit — average voltage, timer frequency, RC settling, or DAC quantization — is actually the active one behind a PWM-versus-DAC choice.
Companion to the chapter Applied: PWM vs DAC Output — every number here comes from that chapter.
Ada: A PWM output choice is only defensible when the arithmetic says which limit is active: average voltage, timer frequency, RC settling, or DAC quantization.
See the relationship before changing it
The figure reads from left to right. The blue card is eight-bit pwm code. The middle card applies this page's rule. The green card is ideal average voltage. Walk the arrows once: set the input, apply the rule, then read the result with its unit.
The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only eight-bit pwm code, so the numeric fixture does not switch without explanation.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 200 code.
- 2
Name the relationship. average = 3.3 V x code / 255
- 3
Substitute with units. 3.3 x 200 / 255 = 2.588 V
- 4
Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.
Predict, then change eight-bit pwm code
Try Predict the direction of average = 3.3 V x code / 255. Test another eight-bit pwm code, then compare ideal average voltage.
Observe A larger PWM code raises ideal average voltage while timer frequency and filter settling remain separate limits. Reset eight-bit pwm code to 200 and compare ideal average voltage.
Explain A larger PWM code raises ideal average voltage while timer frequency and filter settling remain separate limits.
Check yourself
What should you do before trusting a moved-control result?
What does this small model leave out?
Choose Calculate for PWM code 200 at 3.3 V, a 10.24 MHz timer, and the 20 kHz RC-filter case.
The audit returns 2.59 V average, 40 kHz at 8 bits versus 2.5 kHz at 12 bits, and 11 ms filter settling.
Extra timer resolution consumes counter frequency, while stronger RC smoothing consumes response time; a DAC avoids switching ripple when those costs exceed the load's tolerance.
Technical boundaries
For the PWM selection, excluded from this fixed arithmetic are load impedance changes, switching losses, timer jitter, DAC settling transients, or filter-component tolerances.
1. Duty-cycle averaging comes before load physics. The chapter's 30% and code-200 examples both start by converting a duty fraction into an average voltage.
2. Timer resolution spends frequency. With the stated 10.24 MHz timer clock, 12-bit PWM gives 16 times more duty positions than 8-bit PWM, but the PWM carrier falls by the same factor.
3. RC smoothing trades ripple for delay. The chapter's 20 kHz, 10 kohm, 0.22 uF filter pushes the carrier far above cutoff, but the same RC product sets the response time.
4. A DAC removes the carrier but keeps quantization. On the same 3.3 V rail, a 12-bit DAC has small voltage steps and no 20 kHz switching component to filter.
Selection rule: use PWM when the load naturally averages energy and the timer still meets the frequency target. Use a DAC when switching ripple or settling delay is the dominant error.
Every number above is taken from the chapter’s own material and re-derived step by step.