Minimig Video d/a resistor ladder

Equations

 * Defining constants:
 * U_vga = 0.7 V
 * R_vga = 75 Ω
 * U_vcc = 3.3 V


 * Total resistance = 1/(1/4000+1/2000+1/1000+1/560)+75 = 357.8282.. Ω
 * Common current through resistor ladder plus vga impedance (75Ω) = 3.3V / 357.8282.. = 0.009222 A
 * Current * VGA impedance = 0.6917 V (specification says max 0.7V p-p)
 * Output voltage = 75 * (3.3/(1/(1/4000+1/2000+1/1000+1/560)+75)) = 0.6917 V


 * Simplification:
 * U = (75*3.3)/(1/(1/4000+1/2000+1/1000+1/560)+75) = 0.6917V


 * Base resistor value = (1/8+1/4+1/2+1/1)/(1/((R_vga*U_vcc)/U_vga-R_vga)) = 522.3214Ω


 * Deviation summary:
 * 0523/523 = 1.0000
 * 1050/523 = 2.0076
 * 2100/523 = 4.0153
 * 4220/523 = 8.0688


 * As can be seen no more than 1% is useful with digikey resistors. Resistor combinations will add tolerances and use valuable pcb space.
 * Maximum output voltage if VGA impedance is 75Ω is: (75*3.3)/(1/(1/4220+1/2100+1/1050+1/523)+75) = 0.6981 V

Useful links

 * Wikipedia: Resistor
 * Wikipedia: Preferred number
 * Digikey: Resistors
 * Wikipedia: Thin vs Thickfilm resistor
 * In essence Thin = More expensive, but without nasty temperature coefficient.

Digikey ordering:

Value-vs-Amplitude Originaly
The original 4000Ω 2000Ω 1000Ω 560Ω resistors, Gives this curve for the desired vs actual amplitude: Note the dent in the middle of the curve!

Value-vs-Amplitude Modified
The modification with 4220Ω 2100Ω 1050Ω 523Ω resistors, Gives this curve for the desired vs actual amplitude:

Gnuplot
Gnuplot command:
 * gnuplot> plot "dac_sim.txt" using ($1):($2) smooth csplines

Simulation script
Simulation program (perl): $map[$n++]=0; $map[$n++]=8; $map[$n++]=4; $map[$n++]=12; $map[$n++]=2; $map[$n++]=10; $map[$n++]=6; $map[$n++]=14; $map[$n++]=1; $map[$n++]=9; $map[$n++]=5; $map[$n++]=13; $map[$n++]=3; $map[$n++]=11; $map[$n++]=7; $map[$n++]=15;
 * 1) !/usr/bin/perl
 * 2) Created:  2007-08-23 05:25.32
 * 3) Purpose:  Minimig Video D/A resistor ladder simulation
 * 1) Purpose:  Minimig Video D/A resistor ladder simulation

for($v=0; $v<=15; $v++) { $d=$map[$v];

$d3 = ($d & 8)?1:0; $d2 = ($d & 4)?1:0; $d1 = ($d & 2)?1:0; $d0 = ($d & 1)?1:0;

if( !($d3==0 && $d2==0 && $d1==0 && $d0==0)   ) { $r_dac=1/(      ${d3}/4220+ ${d2}/2100+ ${d1}/1050+ ${d0}/523      ); } else { $r_dac=100*1000*1000; }
 * 1)      ${d3}/4000+ ${d2}/2000+ ${d1}/1000+ ${d0}/560

$u = (75*3.3)/($r_dac+75);

printf("%d %f\n",$v,$u); }