> I think I did a version of this that used 6 =A0switches or so. IIRC I > found the best solution was to feed the the power via a constant > current source. That way the voltage across the resistors was directly > proportional to the resistance & I had a larger working voltage range > and well defined voltages. After a quick skim through the posts so far Richards suggestion sounds most useful, albeit taking slightly more electronics than a simple divider. Off the top of my head - lets see how we go: E&OE. Assume resistors are scaled in steps of 2:1. Lower than this will cause negative steps in the output for monotonically increasing binary values of the switches (000000 000001 000010 000011 ...) Higher ratios between switches produce "interesting" results. It's not obvious that this is useful. With a constant current source and series string the voltage is "exactly" proportional to the sum of resistances. The worst case error has to be less than 1/2 of the change from excluding/including the smallest resistor =3D < 0.5 LSB effectively. Worst worst case you can assume that all the errors sum. So for 6 resistors you want 6 x delta R < Rmin/2 or delta R =3D Rmin/12 or more generally delta-R =3D Rmin/2N for N resistors. The required resistor tolerance is worst for the largest resistor. Rmax =3D Rminx 2^(N-1) So required accuracy of largest resistor =3D 1:(Rmin/2N)/ (Rmin x 2^(N-1)) Accuracy of largest resistor =3D 1:N x 2^N or for a 6 stage network =3D 1: 6 x 2^6 =3D 1:384 =3D 0.26% ! This is assuming that all resistors add equal delta R in the same direction and that all resistors are at worst case error limit and that all resistors are in circuit. This is extremely unlikely to be true. Less completely: Error allowed in largest R is less than 1/2 value of lowest R =3D 1: 2^(N-1) x 2 =3D 1:2^N For 6 resistors =3D 1/64 =3D 1.6% so 1% resistors would be OK. BUT this assumes that this is the sole error source. BUT for resistors in 2:1 ratios a 1% resistor at R/2 will look like 0.5%, at R/4 will look like 0.25% etc. SO worst case 6x 1% resistors with all worst case delta R in one direction will look like 1% + 0.5% + 0.25% + ... -> asymptotes to 2% for N large (and 98%+ there at 6 steps) As "allowed" error =3D 1.6%, using 1% resistors will "almost always work OK= " [tm]. ie trimming the Rmax value may be wise. Note that the above is for a perfect conversion accuracy and perfectly controlled current source. One workaround is to note observed values and calculate likely true value of current source wrt nominal. Not necessary in most cases but could be useful. One reason that this accuracy is about 1/2 as good as may be intuitive or desireable is the swamping effect of Rmax - as it is 2 x the sum of all lower values it dominates the error result and the error doubles for every stage added. By scaling at some lesser ratio you get overlap between values. By scaling at higher values you place more demands on the higher stages. This would allow eg very precise values of the top few resistors to be used with the others requiring much less accuracy. Temperature effects alone are liable to make this unattractive. E&OE, again Russell McMahon --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .