cancel
Showing results for 
Search instead for 
Did you mean: 

How do I choose the best ADC sampling time?

bob239955
Associate II
Posted on February 25, 2008 at 11:10

How do I choose the best ADC sampling time?

4 REPLIES 4
bob239955
Associate II
Posted on May 17, 2011 at 12:24

Q1. The ADC Sampling time is programmable. How do I decide the best time? Why not just go for the fastest and average as many readings as I can take in the target update time?

Q2. I can read the same channel N times into an array in memory for oversampling. If I read one channel into the SAME memory location N times does that memory location contain the mean of the samples or just the last sample?

obtronix
Associate II
Posted on May 17, 2011 at 12:24

A1: The faster you run the A/D the more power is required and the more accurate/expensive your analog circuitry has to be and the more time your processor has to be awake to process the data. You want to run the slowest rate possible. Run the A/D at about 5 to 10x the signal bandwidth (how fast the signal can change). A slow moving thermocouple might be 10 times a second, a fast MEMS accelerometer set to 1000Hz bandwidth requires 5000-10000 samples a second, ambient pressure/temperature might be once a minute.

A2. Last sample

bob239955
Associate II
Posted on May 17, 2011 at 12:24

Thanks obtronix.

1) yes - I can see lower speed can save power. I'd also use DMA to reduce processor overhead and have processor awake in this case.

2) The question asking if reading ADC (by DMA)to the same memory multiple time gave a mean, arose because of page 49 here;-

http://www.arrowne.com/stmicro/seminar_2007/STM32_Peripherals_STM32_Seminar_Oct_2007.pdf

I just wanted to be sure.

tta
Associate II
Posted on May 17, 2011 at 12:24

you are right page 49 show oversampling of ch7 into one result,

this is not smart to show it like this, it will confuse people to think

the ADC can perform this by it self, that is not the case !

oversampling is handled manually or by interrupt routine