2021-05-25 01:56 AM
Hello,
I would like to have timer interrupts every 10 minutes for temperature readings. Also, I would like to have opportunity to change this period in the code. How could such long period be implemented? Are there any examples? I am using STM32L011F4 MCU and STM32CubeIDE environment.
Thank you.
2021-05-25 03:29 PM
> But if I use counting, it will act like delay which results in blocking the program.
No.
Simply setup up the timer for the 1 minute period, enable it, enable interrupt, and set a global variable to 10. In the ISR, decrement that global variable, and once it reaches 0, you do your action (temperature measurement). Counting happens only once in a minute in the ISR, the rest of program runs as usually.
JW
2021-05-25 04:40 PM
For long duration presumably you could use the RTC Alarm?