2022-03-10 06:20 AM
I am working on a project where I use the NUCLEO-L433RC-P board and CubeMX to configure the settings.
The project use ADC and DMA, when I calculate the conversion time, I get a value less than 15 ADC clock cycles.
I calculate the conversion time by measuring the times for making 60 conversions and 10 conversions. I subtract the two times and divide it by 50 to get the time for one conversion.
The conversion time differ between 13.2 and 14.5 ADC clock cycles depending on the ADC clock.
Example:
SYS clock and ADC clock is 11MHz
Time ADC start to HAL_ADC_ConvCpltCallback sample 60 values 94 µs.
Time ADC start to HAL_ADC_ConvCpltCallback sample 10 values 34 µs.
Conversion time (ADC clocks): ((0.000094-0.000034)/50)*(11000000) = 13,2
Is there a logic explanation for this?
2022-03-10 06:34 AM
Just errors due to a not very precise timing method. HAL calls add overhead and jitter. What do you think it should be instead? Perhaps measure the different between 1000 and 10000 calls to reduce overhead error.
2022-03-11 12:45 AM
Hi TDK Thank you for the quick reply, if I make 9000 conversions the conversion time is 15 ADC clocks as expected. I think the error in my 60/10 calculation is that the measured time for 10 values conversions of is wrong (too long), and the delta time then get too short.