cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 ADC Total Conversion Time measurement - DMA mode

hesam moshiri
Associate III
Posted on July 02, 2018 at 19:20

Hi,

I'm working on a STM32F407 chip and I have enabled one of its ADCs and I read the values by the DMA. I mean using this HAL function: HAL_ADC_Start_DMA

is there anyway to measure the ADC sampling time or conversion time? (according to the datasheet it must be around 2.4Msps for each ADC).

I don't mean by calculations, I mean measuring it in the live debugger or something like that. 

#adc-speed #adc-sampling-time #dma-adc #stm32f407
1 ACCEPTED SOLUTION

Accepted Solutions
hesam moshiri
Associate III
Posted on July 04, 2018 at 11:43

I solved this by enabling the DMA interrupt and checking its triggering frequency. 

🙂

View solution in original post

4 REPLIES 4
AvaTar
Lead
Posted on July 03, 2018 at 07:18

I think not.

And as mentioned in another thread here, the ADC is a relatively simple state machine, that executes the configured operation in the number of clock cycles specified.

You can try to measure the time from the start of conversion to the EOC/EOS interrupt, either with a scope or the cycle counter. Need to subtract the 12 cycles for interrupt entry, though.

Not sure (and don't care) what additional ballast Cube builds around that.

Posted on July 03, 2018 at 08:33

Actually the sampling rate or conversion time is very important in my application and I want to make sure that it does the job 'on time' with maximum speed.

Actually I have measured the time by the DMA interrupt occurrence, but it is slower in term of the last argument in the 

HAL_ADC_Start_DMA 

function. I can not put values lower than 10 for that and by 10, I get a signal around 100KHz. it means each conversion at 5uS.
hesam moshiri
Associate III
Posted on July 04, 2018 at 11:43

I solved this by enabling the DMA interrupt and checking its triggering frequency. 

🙂

Posted on July 04, 2018 at 12:49

To be correct, this includes the time DMA needs to move the value across the bus.