cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling frequency for STM32L476RG in dual regular simultaneous mode?

AKhot.1
Senior

I have set the ADC clock frequency to 80 MHz and I am operating the ADC1 and ADC2 in dual regular simultaneous mode where sampling cycles I have set to 2.5cycles each, so what will be the sampling frequency for the signal?

6 REPLIES 6
AKhot.1
Senior

From calculations:

Total conversion time = (2.5 + 12.5) / 80MHz

so, Sampling Frequency = 80 / (2.5 + 12.5) = 5.33MS/s = 5 MHz for each ADC.

But what happens when it operates in dual regular simultaneous mode? Does it get half/same/doubled?

When I capture the input signal of 100KHz and plot FFT; at 2MS/s I get a correct FFT peak frequency not at 5.3MS/s. 2MS/s is not even a half of 5.33MS/s.

Please help with the calculations.

AScha.3
Chief II

>in dual regular simultaneous mode?>Does it get half/same/doubled?

no, nothing. you just get result of both adc at same time , in their data registers.

If you feel a post has answered your question, please click "Accept as Solution".
AKhot.1
Senior

Yes agree but what is the sampling time for the both ADCs?

JR2963
Senior II

I think if your ADC clock are 80 MHz- then 15 ADC cycles takes 187,5 nsec. If you have regular simultaneous mode, it will still takes 187.5 nsec, but you should have 2 results (one from each ADC).

Did you try to measure it? If not, try to measure how long takes to get e.g. 500 samples (ideally using DMA) - then you can compare.

Also you can double check ADC clock - do you have sync or async clock?

I have a async clock. After conversion, I am serially transmitting data to MATLAB and there checking the FFT. There at 2MHz I am getting the correct frequency.

How do you measure the time required to convert some x no. of samples?

you can turn some pin to high, then start to measure 500 samples and when finished you turn the same pin to low - on osciloscope you can measure the time...

Probably your sampling freq will be different then you expect