2025-11-25 12:55 AM - last edited on 2025-11-25 1:48 AM by Andrew Neil
Hi there.
I’m trying to generate a 12 ns pulse for a time-of-flight (ToF) application.
I’m using an STM32U5 microcontroller, and I’d like to know whether one of the general-purpose timers (TIM2/TIM3/TIM4/TIM5) can produce a pulse that narrow. With a 160 MHz timer clock, the time resolution is about 6 ns, so in principle it seems feasible, but I may be overlooking something.
Thanks!
Solved! Go to Solution.
2025-11-26 7:01 AM
I’m not completely sure, but since the call to enable the counter was placed inside an infinite loop, what you describe is likely part of the cause. It definitely wasn’t the best approach, but I only needed a quick check to see whether a 1-tick or 2-tick pulse was achievable (this was my first time generating pulses). Now I’ll implement it properly in my application.
2025-11-26 9:03 AM
Lesson learned.
Thanks for coming back with the solution.
JW