cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303 actual samples per second from ADC

EmbeddedErik
Associate II

Hello! I am trying to figure out my sampling time from my ADC. The setup i have:

A number of ADC:s setup with a DMA. All ADC has the same sample time, set to 19.5 ADC cycles. All ADC is 12 bit, so from my understanding, we have 19.5 + 12.5 = 32 ADC cycles so far. The ADCCLK is set to 64MHz.

If I understood the Reference manual correctly, this would mean the total conversion time for the ADC is: (1/64MHz) * 32 = 0.5 microseconds. If this value is correct(Correct me if its wrong), then would this mean that the DMA interrupt would fire this often, or am I wrong? I am more interested in knowing how many samples per second I could expect realistically with my setup. I imagine this would also depend on the size of my interrupt, but we don't have to be that precise.

Thank you in advance, and let me know if any more info is needed!

2 REPLIES 2
LCE
Principal

Better first read about ADC basics, then DMA:

- 12 bit is the amplitude resolution and has not much to do with sampling time
- 64 MHz might be the CPU clock, but is probably not the ADC clock (check datasheet for maximum, set prescaler accordingly)
- DMA is normally used with buffers which can hold several ADC words, so that DMA complete interrupt is only triggered when the buffer is full

You are correct, I misread my own code. The actual ADCCLK is 64 MHz / 6 = 10.7MHz. Regarding the 12 bit, I read in the reference manual that depending on the resolution, it has an affect on the conversion speed, which should have an impact on the sample time?

I will look into the specifics of the DMA more.