ADC Speed

Coyoteboy

Senior Member
Can anyone tell me how long the 08M ADC input reading takes to complete? I'm reading a 0-1V input and I'd like it to be as fast a response time as possible to update the LCD output - so assuming I have a loop of

main:
readadc
LCD->update
goto main

whats my maximum 'polling' rate at 4MHz (assuming LCD update is 0, which i know it isnt), and does it become unstable at 8Mhz if i were to overclock it and subsequently halve the serial comms rate to the LCD firmware to bring that back to 2400?

Cheers
James
 

hippy

Technical Support
Staff member
According to http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=1157 both READADC and READADC10 take about 680uS. I would guess it remains stable at 8MHz.

Sending three bytes to the LCD, to set the cursor position and print a single digit would take just under 14mS no matter what oscillator speed, which would give a total of about 15mS, a maximum sampling rate of around 65 per second.

Sending a three digit reading would reduce the sampling rate to about 41 per second.

The READADC times is much less significant than the time taken to send the data to the LCD, so operating at 8MHz won't produce any real gain; possibly one or two extra samples per second at best.

Adding extra code to convert the reading for display and to format the display could also reduce the sampling rate quite drastically.
 

Coyoteboy

Senior Member
Excellent info, thanks. I'm only looking for 10-15 updates a second really, just didnt want the output to be too 'stepping' in nature - i have another temp sensing system that updates every half second - which would be useless for what i want to watch, so thats smashing :D

How did you find that info - i searched for about half an hour solid and couldnt find it!

Cheers!
James
 

hippy

Technical Support
Staff member
The READADC timing was a lucky hit - and it also showed that what I'd been proposing to do with timing measurements myself had already been done, but that didn't turn up on another search I'd tried ( or I missed it ).

The SEROUT timing is obtained from, txBitTime=1/baud and txByteTime=10*txBitTime.
 
Top