2024-04-13 06:59 AM
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?
2024-04-13 09:50 AM
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.
2024-04-15 03:34 AM
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.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.