Skip to main content
M_J
Associate II
June 28, 2023
Question

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

  • June 28, 2023
  • 3 replies
  • 1104 views

..

    This topic has been closed for replies.

    3 replies

    Pavel A.
    June 28, 2023

    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.

    Tesla DeLorean
    Guru
    June 28, 2023

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrei Chichak
    Lead
    June 28, 2023

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