Gerhard Fiedler wrote: > > How complex is your analog circuit to get 16 bit precision (not resolution) > out of it? I thought you'd need at least an opamp (for the const charging > current), a comparator (might be the built-in of some of the PICs), and a > good temp compensated reference. And probably a way to do calibration runs > once in a while, i.e. some analog switches. I received a lot of private mail explaining the exponential V vs t curve when a cap charges. I know this, it is just that I like to get away with the minimum hardware when possible. Somewhere in my original mail I did state that you'd need some 16 bit number crunching. I beleive that, in most cases, the time and memory needed for this purpose may be worth it. Assume you have 16 bit math routines in your software. The exponential function may be broken up as a series of terms. This is scaled against the time measured for the known voltage (the I/O pin). > Easier to get this precision seems to be comparing a PWM output to the > input, but then this is still slower. For slowly changing input signals it > might be useable though; you can track the input, speeding the process > quite a bit up. Good point. I don't think a few ms will make or break most applications. -- Friendly Regards Tjaart van der Walt mailto:tjaart@wasp.co.za _____________________________________________________________ | Another sun-deprived R&D Engineer slaving away in a dungeon | | WASP International http://wasp.co.za | | GSM and GPS value-added applications | | Voice : +27-(0)11-622-8686 | Fax : +27-(0)11-622-8973 | |_____________________________________________________________|