C7 Digital logic · Practice
PWM and sigma-delta outputs
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
A PWM generator runs its 8-bit counter from a 16 MHz clock. What is the PWM frequency, in kHz?
Write units the way you normally would: 1.5 kHz, 1500 Hz and 0.0015 MHz are the same answer.
Check
A 3.3 V PWM at 62.5 kHz and duty 0.2 drives an RC filter with = 10 ms. What's the peak-to-peak ripple, in mV?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
Check
A 3.3 V, 8-bit PWM from a 64 MHz clock must have at most 1 LSB of ripple at its worst duty. What filter time constant does it need?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
A 10-bit first-order sigma-delta should output a 1 once every 4 clocks. What input code does that?
Check
For an 8-bit code , by what factor is the sigma-delta's ripple smaller than the PWM's through the same slow filter? (Give the ratio of sigma-delta to PWM.)
Check
Simulate both modulators through an RC filter. With an N-bit counter (6) and code k = 5, build 64 periods' worth of bits ( clocks) for PWM (1 while count < k) and for the sigma-delta (carry of an N-bit accumulator starting at 0). Filter each with the exact one-pole update v = v + (b - v)*a per clock, a = 1 - exp(-1/50) (RC = 50 clocks), starting from v = k/2**N. Over the last two PWM periods, set pwm_pp and sd_pp to the peak-to-peak values, and ratio = sd_pp/pwm_pp.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What PWM frequency does an 8-bit counter on a 20 MHz clock give?
Write units the way you normally would: 1.5 kHz, 1500 Hz and 0.0015 MHz are the same answer.
Check
What's the step size of an 8-bit PWM output on 3.3 V, after filtering?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C7