cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303 ADC conversion time

KHedi.1
Associate II

Hi, I am using STM32F3Discovery board for our project at the moment. We need to sample 4 different signals at the same time so we are using all 4 available ADCs in parallel. We are triggering all the ADCs with Timer3 at 100kHz and to make sure the timing is OK we output a GPIO pulse when the conversion complete interrupt is triggered (only one of the ADCs is interrupt enabled) . We checked the signals on the oscilloscope and it seem that after the ADC conversion start trigger (Timer3 rising edge), it takes about 2.5us to enter the conversion complete interrupt service routine. In the reference manual it says the conversion time is 0.21us for slow channels. We were planning to sample 1MHz signals but we are struggling with 100kHz. We are using the fastest possible settings available on CubeMX, what can be causing this factor of 10 error?

Thanks,

Kıvanç

12 REPLIES 12
Uwe Bonnes
Principal III

You do not tell about the sampling time you use.

KHedi.1
Associate II

1.5 cycles.

KHedi.1
Associate II

0693W00000FBTZrQAP.pngThis is the scope image. Yellow trace is the timer output. All ADCs are triggered on the rising edge. The blue trace is the GPIO pulse generated within the ADC interrupt. According to this ADC conversion takes 2us from start to finish.

Uwe Bonnes
Principal III

Recheck your setup? Are you really running at 72 MHz?I was able to use the F303 ADC as describes with the speed expected.

0693W00000FBVNmQAP.png 

You can see the clock configuration above. It must be correct as the timer frequency is exactly the same as expected.

0693W00000FBVTfQAP.pngThis is the ADC configuration for one of the ADCs.

TDK
Guru

Toggling a pin isn't going to give you accurate timing here. It will include overhead of the IRQ entry. That isn't enough to explain the entire delay, but it explains a chunk of it.

If you want to verify speed, do a bunch of conversions back to back, say 10000, use DMA to transfer, and measure the time it takes to complete. This will include minimal overhead.

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

did you find a solution.. same problem ı have , ı m use stm32h7,, adc conversion time very long,, ı measure adc conversion time.

No, unfortunately...