2022-12-22 07:58 AM
Hello everyone,
I got a time1 on STM32F103C8 running at 72Mhz with settings:
If I used an interrupt, I would get callback every 30 seconds, however I want to do basically same using polling method, is there a register or a HAL function I can use to check for an update flag and clear it myself?
Solved! Go to Solution.
2022-12-22 11:36 AM
There is an interrupt flag that turns to 1 when an interrupt should occur. There is also an enable interrupt that makes the interrupt happen when the interrupt flag goes to 1.
You need to keep the interrupt enable 0 (not activated) and watch (poll) the interrupt flag. When the interrupt flag goes high it will stay high until you switch it to 0. Your polling routine should do this. When it sees it go high, do your task, and reset it back to zero until it goes to 1 again.
2022-12-22 11:36 AM
There is an interrupt flag that turns to 1 when an interrupt should occur. There is also an enable interrupt that makes the interrupt happen when the interrupt flag goes to 1.
You need to keep the interrupt enable 0 (not activated) and watch (poll) the interrupt flag. When the interrupt flag goes high it will stay high until you switch it to 0. Your polling routine should do this. When it sees it go high, do your task, and reset it back to zero until it goes to 1 again.
2022-12-22 06:35 PM
Usually a status flag is created to report an event. Sey by hw and cleared by sw. From this bit, it goes through an interrupt enable bit to provide in the end your callback, if you need it. Polling is a quick start. When core workload and power saving comes into play, polling looks gross. So you know what is waiting for you down the road....