2023-07-07 12:57 AM
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!
2023-07-07 03:20 AM
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
2023-07-07 03:34 AM
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.