Re:How to flash an LED: writing ARM assembly for an STM32 mi...
by MuffinFlavored on Friday April 03, 2020 @09:01PM
(#22775345)
How do multiple processes usually 'share' a timer?
Re:How to flash an LED: writing ARM assembly for an STM32 mi...
by rdc12 on Friday April 03, 2020 @10:00PM
(#22775593)
Microcontrollers (assuming no RTOS in use), typically don't have multiple processes, they have the main thread of execution (which in the article is the entire program) and have interrupt routines that a run in response to an external event (in this case, the timer has expired).
Using the interrupt driven approach, can led to better performance both in CPU time (async communication with slower periphials etc) and battery life (sleep states).
This would take a fair bit more code to configure the timer, and setup an interrupt to handle the timer.