2025-01-14 08:13 AM
Hello,
My goal is to setup a timer which also runs when the device is in (Zigbee) sleep mode. I have tried to adapt HAL_GetTick() to be run by LPTIM1 on an STM32WB5MMG, which led to the device not boot anymore. I also tried setup timestamps on the RTC which did not solve the original problem.
Is there some predefined solution to solve my problem or some example projects that demonstrate the use of LPTIM1 for my usecase?
Best regards
2025-01-23 12:15 AM
Hello,
Zigbee example provided in our repositories are using Timer server(AN5289 - chapter 4.5 Timer Server for more info), which is clocked by RTC-LSE (running also in low power modes down to shutdown).
Would Timer server functionality fulfil your needs?
Best regards,
Lubos
2025-01-23 12:43 AM
Hi,
I'm not yet familiar with all the peripheralS of STM32 MCU, but in any case it's possible add an external oscillator to microcontroller design. Depending frequency, accuracy, stability; it can be a crystal, ceramic, or RC. Some circuits can be made with CMOS inverters, oscillators divisors, or if there is relationship with HMS, dedicated IC at low frequency.
As inverter: 74HC04. CD2040, CD2040,CD2060 and their evolutions with HC series as oscillators and divisors. DS3231 as Real Time Clock, or equivalent. An famous NE 555 can do the job until 1Mhz. The last question is sleep mode. External oscillator can be consuming, Then the right balance must be found to deal with the sleep current.
Regards.
Butterfly