Skip to main content
April 7, 2024
Solved

How can I view the number of ADC conversions per second?

  • April 7, 2024
  • 8 replies
  • 2547 views
This topic has been closed for replies.
Best answer by MM..1

ADC DMA isnt designed for one sample buffer, or better say your complete callback cant be more instruction cycles as one conversion when you set one as buffer = next not practical chaos

Your code is in IRQ and next IRQ arrive = stop working

8 replies

April 7, 2024

 

Hello
I am using STM32G030 but my question is not specific to G series

 

How can I view the number of ADC conversions per second?

 

For example I can put Counter++ in (DMA circular )HAL_ADC_ConvCpltCallback  And get it in seconds using a timer?

 

The G030 has a 12-bit ADC with 2Ms/s

 

ADC clock of 32 MHz divided by 2 = 16 MHz (12.5 + 1.5) should be 1.1Msample/s? is not it?

 

Is this practical?

 
 
 
 
 
 
 
 
 
MM..1
Super User
April 7, 2024

Your question is not practical. ADC have docu and on init you define speed of conversion . 

Some years ago i here ask why MX not shown this values , when ADC is configured. I mean still not show, then you need calc this. For example 

MM1_0-1712486267857.png

STM32G0-Analog-ADC-ADC.pdf

April 7, 2024

I am testing it right now
When I put ADC_SAMPLETIME_160CYCLES_5, the counter shows the number 92486. But when I set it to ADC_SAMPLETIME_79CYCLES_5, it stops working