max. sampling rate ADC LPC1768

11 Jul 2012

hi,

i have a 16 kHz signal an need 10 samples per period, but the ADC seems too slow.

I tried this:

#include "mbed.h"

Serial pc(USBTX, USBRX);
Timer timer;
AnalogIn a_PD[] = {(p16),(p17),(p18),(p19),(p20)};
float voltage;

float stop; 

int main() {
    while(1) {
        timer.reset();
        timer.start();        
        
        voltage=a_PD[5];
        
        stop=timer.read();
        pc.printf ("Timer: %f\n", stop);
        
    }
}

The time for one sample is 0,000022s=22us. Thats only a sampling rate from 45,5kHZ, but the datasheet says something about 200kHz.

Where is the mistake?

13 Jul 2012

Can I suggest commenting out the voltage=a_PD[5]; line to see what the latent time of the start to stop is.

Also can you setup for a single Ain channel to see what other overheads your program might be introducing.