>If you're using the LM324 as a buffer amplifier (which I think is >necessary for almost every application [the amp not the 324 per se]) then >why not do something like so: > > | /| > | /+|----------<< Vin > | / | > +----< | > | \ | >P | \-|--+ >I | \| | >C | | > | | > +--/\/\/\---+ > | | > | === > | | > | --- > | /// > >The 324 is being configured as a comparator. If Vin is greater than the DC >voltage on the capacitor, then the 324's output is high. The only problem >I see with this approach is that the voltage on the capacitor is a >function of the PIC's supply voltage - which may be too noisy or too >inaccurate for a 12-bit A/D converter. (This problem exists with the 1 and >2 I/O line a/d converters too, btw.) The programmable current source that >you show above addresses this issue if it's powered from a voltage >reference or perhaps a well filtered version of the power supply. It's >possible to also design a precise current source using a LM324. I previously tried this but using the Z8's internal comparator as a comparator (seemed like a good idea :-)). Results were not as good as the prior version Using an LM324 here is not practical at "real"speeds although some other amps or comparators would be OK. The LM324 has a woefully low slew rate and gain-bandwidth and the output does not like being below 0.6 volts from lower rail and the input common mode voltage and output max are Vcc-1.5 volts. All told this adds up to a lot of limitations. Unfortunately its 5 times cheaper than anything else (someone please point out something far superior and about as cheap and I'll be very happy). LM324 is about $US0.16 in 10,000 volume. Dual version is about the same price. RM