How to sample faster


dear community,


i trying sample 40 khz sine wave analog pin. using arduino mega2560. has atmega2560 micro controller.

i need sampling rate of 150 khz 200+khz or more.

the reason because need compare phase shift reference 40 khz signal.



ok, have changed adc clock prescalar 128 4!. able sample @ 100 khz. surprisingly still retains sampling accuracy. sampling works not fast enough me determine small phase shifts between signals.

so need finding way sample faster. had mentioned possible skip analogread together, not know how that. perhaps there way edit analogread library?

i open other options/solutions , -jd

per atmel datasheet, not 328p meets needs analog sampling speed.

features
• 10-bit resolution
• 0.5 lsb integral non-linearity
• ± 2 lsb absolute accuracy
13 - 260µs conversion time
up 76.9ksps (up 15ksps @ maximum resolution)
• 6 multiplexed single ended input channels
• 2 additional multiplexed single ended input channels (tqfp , qfn/mlf package only)
• temperature sensor input channel
• optional left adjustment adc result readout
• 0 - vcc adc input voltage range
• selectable 1.1v adc reference voltage
• free running or single conversion mode
• interrupt on adc conversion complete
• sleep mode noise canceler


you might have better luck detecting peaks or 0 crossings, , doing interrupt on that, , comparing times determine phase difference. think probably, in general, better way it.


Arduino Forum > Using Arduino > Microcontrollers > How to sample faster


arduino

Comments