cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 specs for ADC are 2.4 MSPS. my waveform generator set at 500 KHz captures 12 values from peak to peak, indicating 6 MSPS. Using DMA, no repeat values to indicate it is re-reading the adc_dr . ???

Colin_R
Associate II
 
4 REPLIES 4
TDK
Guru

More details on your ADC setup would be useful. In particular, how you're triggering it and how you're determining how fast it's running.

The ADC clock and conversion rates are covered in the reference manual and datasheet, and they're accurate.

If you feel a post has answered your question, please click "Accept as Solution".
Colin_R
Associate II

I have the ADC set to continuous conversion, the DMA takes each value once converted and sends to a buffer [200], from there I read off the values in the array which appear to be representative of the sinusoid I am inputting. for various different frequencies from 1 KHz to 1 MHz I appear to consistently get 6 MSPS by counting the number of conversions from peak to peak, then multiplying by the input frequency. sample time = 3 cycles, 12 bit = 12 cycles and the max frequency achievable is 72 MHz for the bus with the prescaler set (automatically) to 2. Therefore max conversion rate should be 72/2/(12+3) = 2.4 MSPS as per spec. The catch is, I am toggling a GPIO pin whenever the buffer fills, and the rate at which it toggles indicates a conversion rate of 2.38 MSPS, almost perfectly as per specs with the overheads for pin toggling I suppose. I only have an analog discovery 2 as an oscilloscope, so I can only self-verify its accuracy by inputting its own wave generator to a scope input, which performs as expected.

TDK
Guru

> I appear to consistently get 6 MSPS by counting the number of conversions from peak to peak

> The catch is, I am toggling a GPIO pin whenever the buffer fills, and the rate at which it toggles indicates a conversion rate of 2.38 MSPS

These statements contradict each other. There must be an error in which you're calculating one of these values. My guess is the latter is correct, as it matches up with the expectations in the reference manual and datasheet. Hard to know where you went wrong as you don't show your math.

If you feel a post has answered your question, please click "Accept as Solution".
Colin_R
Associate II

I completely agree that they contradict each other, hence my conundrum. The math I apologise for not including explicitly, it was nested in the original post. 12 values peak to peak at 500 KHz = 12*500 000 = 6 MSPS. Other frequencies input by wave generator are:

58 samples at 100 KHz = 5.8 MSPS

30 samples at 200 KHz = 6 MSPS

12 samples at 500KHz = 6 MSPS observable peaks

6 samples at 1 MHz = 6 MSPS peak not defined on half of the cycles

I'm certain this is operator error and that I don't have a magic ADC, but I can't see where.