For those who are input pin constrained (i.e. 08M), here is another simple and clever way to read multiple switches and a potentiometer on a single ADC pin.
The April 22, 2010 issue of EDN Magazine (page 71) or HERE (if you don't have the magazine) shows how to do it. I have used something similar with great success; just be sure to have an ample "guard band" around each input device for reliable operation, as all inputs map into the dynamic range of the ADC.
Note: There is an error on the supplied schematic. See it?
Hint: The supplied equations and spreadsheet analyze both a voltage divider AND parallel resistors!
Richard
The April 22, 2010 issue of EDN Magazine (page 71) or HERE (if you don't have the magazine) shows how to do it. I have used something similar with great success; just be sure to have an ample "guard band" around each input device for reliable operation, as all inputs map into the dynamic range of the ADC.
Note: There is an error on the supplied schematic. See it?
Hint: The supplied equations and spreadsheet analyze both a voltage divider AND parallel resistors!
Richard