PDA

View Full Version : POT delay?



astrosteve
- 28th January 2006, 20:00
Does anyone know the approximate delay in executing the POT statement? From the details in the manual, it appears as though the resulting value is a function of capacitor discharge through a resistor. Thus, there must be some timeframe involved to allow this to occur. Does anyone know how long I should allow for this to occur in a time-sensitive application?

thanks,

astrosteve

Ron Marcus
- 28th January 2006, 21:23
Does anyone know the approximate delay in executing the POT statement? From the details in the manual, it appears as though the resulting value is a function of capacitor discharge through a resistor. Thus, there must be some timeframe involved to allow this to occur. Does anyone know how long I should allow for this to occur in a time-sensitive application?

thanks,

astrosteve
Steve,
I don't have my manual, but the pot command uses the RC time constant between charge and discharge (discharge and charge?) to affix an 8 bit number to the discharge time. As such, this is a variable time delay, and you can only plan for the longest possible delay. If this delay time is too long, you can reduce the cap value, or the pot value. It will reduce the usable range, but give you more time to do other things in software. I did an assembly routine that works on behind the scenes using interrupts. I used port B.0 and charged it to B+, set the interrupt and timer1 to start counting. When the pin went low, the routine stopped the timer, and flagged that it was complete. It was a simple thing to read that value out and take that variable for use at my leisure.
Hope this helps,
Ron

mister_e
- 29th January 2006, 00:14
Why spending time when life could be much easier and reliable. Use a PIC with an internal ADC AND THEN you have the full control of it.

You can even know the aquisition time... datasheet

and use the following link to know how to measure it in real time => http://www.picbasic.co.uk/forum/showthread.php?t=365