2023-11-11 10:13 PM
Hi, I am developing digital control for power electronics for which ADC conversion time is critically. In stm32f334r8 reference manual I saw it takes only 0.19us at lowest sampling time i.e 1.5 cycles. when I tried to measure the adc conversion time , its about 1.8us which is not acceptable if my mesurment is correct.
This is how I mesured ADC conversion time:-
adc is triggred by HRTIM Timer A compare unite 2 at some compare value which generates interrupt where I set a gpio pin and after the ADC EOC(end of conversion) there is an ADC interrupt where I reset the gpio which was set at HRTIM Timer A interrupt. So the time on duration of gpio should give conversion time. The gpio pin is at high speed mode. ADC clock is at 72MHZ which is max for stm32f334r8. So I need your help in this. And yes its only one channel.
2023-11-11 11:21 PM
Dear @vasudev,
I would suggest to check the clock input to the fast ADC if it is 72MHz.
Hope it helps,
STOne-32
2023-11-11 11:43 PM
yes the ADC clock input is 72MHZ and also i am using fast adc channel .
2023-11-12 12:20 AM
>I tried to measure the adc conversion time
but what you do, is measure of : HAL-call (using HAL bad idea here)+ADC conv.time + INT call time .
2023-11-12 12:54 AM
that makes sense but i am using LL functions . will it also cause latency ? wat is the best way to measure the conversion time then ?
2023-11-12 01:34 AM
>will it also cause latency ?
no no, this all working with zero-point-energy and infinite speed. :)
why you want measure the conversion time then ? not trusting the manual or STM at all ?
it will convert in exactly the time that you set in its register setup.
just to see, that you didnt it wrong - make a loop , 1000 conversion in continuous mode, and set/reset the led then.
so this time /1000 is ( conversion + poll_for_conversion time + loop time ) .
or better :
set adc in continuous mode, and dma to transfer 1000 result. test time (with your led) from dma start to ready (int).
2023-11-12 03:38 AM
yaa , there significant around 400ns latency with gpio, which adds up to mesurment error of conversion time. So i wil now trust the manual blindly :beaming_face_with_smiling_eyes:.