ADC read speed

14 Dec 2009

Can anyone tell me how fast an ADC read is?  I know that the performance of the LPC1768 is fast, but how fast is the code used here? I am hoping that I can reach the 200 kHz conversion rate of the chip.  Can anyone who has tested it tell me their experience?

14 Dec 2009

The manual says:

12-bit successive approximation analog to digital converter.
• Input multiplexing among 8 pins.
• Power-down mode.
• Measurement range VREFN to VREFP (typically 3 V; not to exceed VDDA voltage level).
• 12-bit conversion rate of 200 kHz.
• Burst conversion mode for single or multiple inputs.
• Optional conversion on transition on input pin or Timer Match signal.

But, as you said, it depends on the code. 200KHz is the burst rate, the software-initiated conversions take "65 clocks" plus however much is the surrounding code (e.g conversion to float or full 16-bit range). Your best bet would be to make a loop of let's say 10000 read()'s and measure the total time with a Timer. Dividing the number of iterations by total time should get you the effective conversion rate.

To get the max speed you'll probably have to fiddle with the registers and interrupts yourself. This, together with the manual should help you get started.