EveryCircuit
Contact
Reviews
Home
yupferris
modified 1 year ago

RPi pico video DAC sim v2

0
0
228
01:28:48
Basic R-2R (composite) video DAC into input impedance. Voltage sources are used to simulate pins (pin output impedance doesn't appear to be listed in the datasheets and is assumed to be low enough to be negligible). We want to use this to output a composite video signal, so we want our max output voltage (shown in green) to be 1V driving the 75ohm input impedance of the receiver. The receiver is assumed to be correctly parallel-terminated, so source termination/impedance matching should not be required. With an 8-bit configuration where each pin outs 0 or 3.3V, the max unloaded output voltage of the DAC network should be Vout=Vref*(2^N-1)/(2^N), with Vref=3.3V and N=8. This yields Vout=3.3*255/256=~3.2871V, with an output impedance of R. This is true for any R, but only unloaded; when driving another circuit, the choice of R affects the output voltage, so we need to choose the correct value. Thus, we have Vin=3.2871V, R2=75ohm, Vout=1V, and Vout=Vin*R2/(R1+R2). Solving for R1, we have R1=R2(1/(Vout/Vin)-1)=171.5325ohms=R, and 2R=343.065ohms. Using these values, we see 0-1V in sim. Unfortunately, there's another constraint when we actually want to build the network: these resistor values aren't particularly common in real parts, but 180ohms and 330ohms are within 5% of R and 2R respectively, and those _are_ common. So, those values have been used instead. With those, we see 0-1,01V instead, within 1% of our voltage target and more than acceptable for this use case. For simplicity, I'm ignoring the effects of resistor value inaccuracies, and assuming 5% tolerance on each should be negligible. As for current draw, admittedly I wasn't entirely sure how to best check/sim this; essentially we want to make sure the maximum current drawn from each pin is below the max in the spec (12mA). I did it the dumb way and hand-checked some simple DAC values by fixing individual PWM widths to 0%/100%. I tried all 0, all 1, and a few one-hot configurations. It appears that the one-hot configurations produce the highest current draw for single pins, with the MSB one-hot configuration producing the highest draw at 8.42mA, which is within our target 12mA limit. Other things to consider include the frequency response of the DAC and glitch/switching conditions. For the former, this DAC configuration behaves closest to an ideal zero-order-hold, which should act as an LPF near our digital nyquist with suppressed aliases. Ideally, we would want to completely remove (lowpass) the aliases and compensate for the lowpass behavior within the intended frequency range (eg. with a pre-emphasis filter), but for simplicity's sake I've completely ignored these effects. Similarly, glitch/switching conditions are also ignored for simplicity.
published 1 year ago

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy