cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the time between Timer start and ADC conversion

Bench
Associate III

Hello all,

I trigger the internal ADCs of a F3 microcontroller simultaneously with a timer1 update event. Now I would like to check the exact time between the timer start and the start of the conversion.

I tried this with toggeling a gpio trigger pin and checking the time at the scope but this includes the conversion time of the adcs as well.

Is there a common solution how to do this?

Thank you a lot in advance!

Best regards!

4 REPLIES 4

Configure one channel of the timer as PWM output and connect its output pin to the ADC input pin. Changing that channel's CCR find a spot where the ADC result changes from one extreme to the other, then in CCR you have the delay between update and the ADC sampling end.

JW

Chris1
Senior III

The conversion time is a predetermined number of ADC clock cycles, based on how you configured the ADC. Since you know the time to EOC, you should be able to subtract the known conversion time to determine when the ADC must have started.

I'd imagine you could get one of the TIM channels to output in toggle mode with CCRx = 0, and observed the edges.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

One edge in any of the PWM modes occurs at overflow/rollover/update/whateveryoucallit...