Olin Lathrop wrote: > peter green wrote: > > The problem is for the ladder to work corrrectly you need switches > > that switch between 0V and 5V, not switches that switch between a > > defined voltage level and open circuit. >=20 > Are you sure about that? You are right if you think of the R-2R ladder a= s > being a voltage source. >=20 > Think of it as being a variable resistance instead. Of course then you > need a current source to turn the value into a linear voltage, but he's > got enough A/D resolution for a compromise to work. For example, if a > bias resistor always drops at least 1/2 the voltage, you get at most a > 2:1 non-linearity with the readings being spread over half the A/D range. I assume you connect the "tail" of the R-2R network permanently to the common point (the same point all the switches are ocnnected to). A 1-bit network gives you 2R or 1R. A 2-bit network gives you 3R, 2R, 1.2R or 1R. A 3-bit network gives you 4R, 3R, 2.2R, 2R, 1.33R, 1.2R, 1.05R or 1R. A 4-bit network gives you 5R, 4R, 3.2R, 3R, 2.33R, 2.2R, 2.05R, 2R, 1.43R, 1.33R, 1.23R, 1.2R, 1.08R, 1.05R, 1.01R or 1R. As you can see, each additional switch puts twice as many values into the lowest 1R span of resistance values, and even at just 4 switches, you need to be able to distinguish values that are as little as 1% apart. There's no straightforward way to "linearize" this. -- Dave Tweed --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .