Long timer interrupt periods
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 1: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.
- Labels:
-
Interrupt
-
STM32CubeIDE
-
STM32L0 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 3: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 4:40 PM
For long duration presumably you could use the RTC Alarm?
Up vote any posts that you find helpful, it shows what's working..

- « Previous
-
- 1
- 2
- Next »