> OK, I'm really intrigued but I admit to not understanding this. I am > currently in a prototype stage using a PIC17C42 and an external ADC. I > would really like to get more resolution. Is there any chance of a more > detailed explanation? What I don't understand is how the square wave > increases the resolution when the ADC (an 8-bit for example) can only > report 256 decision levels. Thanks! One approach I've used for 12 bit a/d conversion with about 3 counts' jitter or 16 bit with about 16 counts' jitter is to use a comparator along with a resistor and capacitor: take the output of a port pin, feed it through the resistor to one leg of the cap. Take the other leg of the cap and ground it. Feed the first leg of the cap into one side of the comparator, and feed the signal input into the other side. The output of the comparator should feed a second port pin on the PIC. The resistor and cap should be chosen so that the RC is fairly long (if you're using a 20KHz interrupt and you're trying for 12 bit accuracy, an RC of a second or so is probably good). Assuming the cap is on the inverting side of the comparator, your software should every 50us or so (preferably faster, but the rate must be consistent) copy the input from the comparator to the output pin. In every 4096 inter- rupts, count how many times you had to output a high and how many times you output a low. This count will be proportional to the input voltage on a scale of 0 volts to Vdd. While this A/D approach is neither as precise nor as fast as a true 12-bit ADC, it is much cheaper and from experimentation it seems to work quite well. One warning, however: while the approach is less succeptible to stray electrons or glitches than the integrator approach used in the MTA14000, it will not work well with the built-in comparators on /Windowed/ 16C62x parts at least not if the RC has a big R and small C. Shining light on the window causes the ADC reading to drift all over the place. Since I've not tried using OTP '620s for this (I just used an external comparator which saved a port pin anyway) I don't know how well they'd work.