Skip to main content
Graduate II
April 13, 2024
Question

RTC or timer?

  • April 13, 2024
  • 2 replies
  • 1953 views

Hello everyone,

In my project on STM32 Nucleo-64 with STM32F401RE MCU, I use a timer (TIM11) at 32 Hz in interrupt mode to get some data from sensors.  

Can I use the RTC (Real-Time Clock) instead of TIM11 to get these data at the same frequency?
If yes, which are the advantages or disadvantages?

 
 
    This topic has been closed for replies.

    2 replies

    Super User
    April 13, 2024

    Hi,

    Now it's working fine with Tim 11 - why use other timers then? Same interrupt to call - just other name. And look, whether RTC can do at this speed, it's more a clock than a general timer.

    So I see nothing useful to change the timer.

    ST Employee
    April 15, 2024

    Hello @thetectivestm

    >>Can I use the RTC (Real-Time Clock) instead of TIM11 to get these data at the same frequency?

    it is possible but as @AScha.3 mentioned, we can't see the usefulness, timers are more flexible, precise and can be easily configured for a wide range of frequencies and modes. 

    The RTC is typically clocked by a 32.768 kHz crystal, which might not provide the same level of precision as a timer.

    Power-wise, timers typically consume more power than the RTC, so maybe you should explain more tour your project's specific requirement, if power consumption is critical and the slight loss in precision is acceptable, the RTC might be the better choice. But if you need higher precision and have no stringent power constraints, sticking with TIM11 could be more appropriate.