Timer cycle duration is always the same
Hello,
My firmware sends data to TTN when I double push on the button of my board. When the first push is detected, the board wakes up from low power mode and a timer is launched to detect if there is a second push. At the end of the countdown, if there was another push, the board sends data. Then, the counter of pushs variable is reset and the board goes in low power mode.
I configured the Timer2 in order that it makes cycles of 500 ms :
- clock source : internal clock (48 MHz)
- prescaler : 1000
- counter period : 24000
- auto-reload preload
- so time interval is : (1 000 * 24 000) / 48 000 000 Hz = 0.5 seconds
My problem is no matter what the value of counter period x prescaler (I tried with 12 000 000, 24 000 000, 4 800 000, 48 000 000), the timer counts cycles of 1min30 (I toggle a LED when a new cycle begins).
Do you have any idea what I did wrong or miss in my firmware ? I can add the source code if needed.
I am using a custom board with the LoRa E5 STM32WL5EJC module embedded, the STM32WL package and the LoRaWAN middleware enabled.
Thanks you in advance
Regards
