2024-04-07 03:09 AM
2024-04-07 04:33 AM
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
2024-04-07 03:15 AM
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?
2024-04-07 03:38 AM
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
2024-04-07 04:00 AM
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
2024-04-07 04:33 AM
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
2024-04-07 04:44 AM
I understood the problem
Is your solution that more channels should be used in this case?
Can you tell me a little more simply what is meant by ADC DMA isnt designed for one sample buffer?
I appreciate you
2024-04-07 05:39 AM
You set buffer length for example 1000 and ADC + DMA do job ofload MCU fill buffer and one IRQ on half 500 and second on 1000 initiate your job in code to do somethink with samples.
2024-04-07 05:56 AM
You mean that, for example, in this microcontroller, 2.5Msample/s for one channel cannot be achieved
How to know the buffer cycle limit for IRQ so that it does not get stuck?
I think it is 100k samples for each buffer for this micro
2024-04-07 06:09 AM
I mean, what do we calculate that doesn't stop according to the number of channels (buffer length) in the IRQ.