cancel
Showing results for 
Search instead for 
Did you mean: 

How to count time ( like 2ms, 3 ms) in stm32f413zh without timer

M_J
Associate II
 
3 REPLIES 3
Pavel A.
Evangelist III

Very easy, and in a lot of ways. For one... set up a UART for baud rate 9600. Transmit a 8-bit character and enable interrupt for TX completion (or poll). It will trigger in 0.96 ms. And so on and so on.

Why?

Without a TIM, or just without using the Interrupt it can optionally generate?

You can free-run most TIM, there are TIM without pins. You can read a value, advancing in micro-seconds.

You could use the DWT CYCCNT and observe processor cycles.

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

Do you consider the SYSTICK as a timer? It does exactly what you want without using a TIM timer.