I have a stm32L432kc nucleo as a master of other device that communicates by RF with other devices, call it Tag. STM32L4 communicates with Tag by SPI. The Tag shall receive RF from other devices at well defined periodic intervals, so the STM32L4 has to put the Tag in RX state some ms before the signal has to be received. This can be done with help of one timer. When the first message is received (RX is on for a long period) then the clock is started with interrupts. When the ISR is called the timer is stopped, the reception is done, and after that the clock is started again. This is done in this way to prevent clock drifting accumulates and the synchronization is lost.
The problem arises when I want to optimize power consumption. I should put the SMT32L4 in stop2 mode between signals (I also put the Tag in deep sleep mode and I have to awaken it before the signal comes).
How can I do that? do I have to use two timers, one for STM32 awakening and other to count for the period between incoming signals?
I have read that the LPTIM does not stop when being in stop 2 mode. Can I use this LPTIM to count for the period between two signals (around 500 ms), and the internal waking unit for awakening the stm32l4 some time earlier (for instance 450 ms)?
Anybody has any sugestion?
Thanks in advance, best regards.