If you check out Microchip's web site (Sorry I don't have the address to hand), I think you will find an app note which does this. Joe At 23:03 02/03/97 -0600, you wrote: >Hello, > As a beginner with PIC's I don't have the programming skills to implement >a function that I would like to use. I have worked with the BASIC STAMP 2 >and would like to make a function that is available on the BS2. It's called >the RCTIME command and what it does is read a resistive value by charging >up a capacitor and measuring how long it takes to discharge through an >unknown resistor. > My idea is to make a pin an output for a fixed length of time, change to >input and loop until it went low, count the loops and return with the value. > Does this sound crazy ?? Would I be wasting my time trying to debug some >code for this function ?? > Any ideas would be appreciated. I'm using a 16C84 with a 4 mhz osc. > My goal is to read a photoresistor. > Thanks !! >James and Iliana Holbrook >Austin Texas >Electronic hobbiest >Automotive Technician >Software Engineer > P.J. McCauley Tel. 353-1-6082218 Dept. Of Pure and Applied Physics, Fax. 353-1-6711759 Trinity college, Dublin 2, Ireland.