cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling the ADC Sampling Rate

Rogers.Gary
Senior II
Posted on December 23, 2014 at 19:32

I've posted on this before, thought I'd nailed it correct, but did not, as there are inconsistent results. I am using the Discovery STM32F4 development board, along with IAR compiler/workbench.

Can someone please point me to a previous post (if there is one) or alternately, sample code, or alternately, pseudo-code that would explain the correct procedure to set up the ADC for an exact sampling rate? Since this is critical in any DSP operations, there must be a way to control that? I realize a timer interrupt is one way - but how about allowing the ADC to ''self-interrupt'', and then set a HW interrupt? If that can be done, can someone provide a link or sample code?

Would be a nice ''ST'' Christmas present all wrapped up under the Discovery STM32F4 development board  8--)

Thanks, and best wishes to everyone for a wonderful Christmas break.

Gary

#adc #stm32f4 #sampling-rate
12 REPLIES 12
mcgilvra2
Associate II
Posted on October 06, 2015 at 19:13

mcgilvra2
Associate II
Posted on October 06, 2015 at 19:15

Is there some example or direction for setting the ADC sampling rate to 19200. I am creating a software UART to demodulate Bell 202 modem audio tones and need 16 samples in a 1200 Hz cycle. Thanks

Posted on October 06, 2015 at 20:43

You'd just adjust the Period/Prescaler of the TIM to get the desired periodicity. I think the timer is explained a handful of posts above this, and I've list a bunch of examples. They don't have your specific sample rate, but that's why the TIM is adjustable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..