At 18:22 20/05/97 -0400, you wrote: >AN 513 discribes a repeatable method of doing an analouge conversion with a >device that is digital only. The method used is based on time measurement. I >have used this method on commercail applications but found it more reliable >if the capacitor charging is acheaved with a variable current as opposed to >variable voltage. Using current charging reduces dirft and increases >accuracy. It is also possable to do the conversion with one pin (remember the >555) but a small r should be placed in series with the pin to avoid excessive >current when discharging the timing capacitor. The circuit used was a fixed >resistor an ORP12 and a 470N capacitor with 100 r in series with the pin. >this gives a repeatable time period baised on ambient light level on a pic >54. > >princable of opperation >1 pin to output >2 pin low >3 start counter >4 pin to input >5 test pin and branch if high >6 inc counter and goto 5 > >this gives repeatable results and is very simple > >Steve.......... I would add one refinement. Use another pin to switch between a known current source (precision resistor to Vcc) and the signal. This allows calibration and makes the results less sensitive to temperature and gate threshold voltage. Keith. ========================================================== Keith Dowsett "Variables won't; constants aren't." E-mail: kdowsett@rpms.ac.uk WWW: http://kd.rpms.ac.uk/index.htm