Cooperative Multitasking. A web-based article on a technique to implement CMT on tiny microcontrollers.
Part 1 describes the building blocks; part 2 has embellishments and methods to keep your code clean.
Pat Beirne e487e5b1aa change side-by-side graphics to "display: flex" style | 12 ore fa | |
---|---|---|
build | 1 giorno fa | |
CooperativeMultitasking.md | 12 ore fa | |
README.md | 1 settimana fa | |
beer_vat.dot | 1 settimana fa | |
beer_vat.png | 1 settimana fa | |
blb.jpg | 1 settimana fa | |
c.xml | 12 ore fa | |
dispatch1.jpg | 1 settimana fa | |
dispatch2.jpg | 1 settimana fa | |
door.dot | 1 settimana fa | |
door.png | 1 settimana fa | |
door2.dot | 1 settimana fa | |
door2.png | 1 settimana fa | |
fridge_state.dot | 1 settimana fa | |
fridge_state.png | 1 settimana fa | |
led_state.dot | 1 settimana fa | |
led_state.png | 1 settimana fa | |
led_state_simple.dot | 1 settimana fa | |
led_state_simple.png | 1 settimana fa | |
makefile | 1 settimana fa | |
pandoc.css | 1 settimana fa | |
postMessage.png | 1 settimana fa | |
radio_tuner.dot | 1 settimana fa | |
radio_tuner.png | 1 settimana fa | |
rtb_state.dot | 1 settimana fa | |
rtb_state.png | 1 settimana fa | |
rtb_state_2.dot | 1 settimana fa | |
rtb_state_2.png | 1 settimana fa | |
rtb_state_3.dot | 1 settimana fa | |
rtb_state_3.png | 1 settimana fa | |
rtb_state_4.dot | 1 settimana fa | |
rtb_state_4.png | 1 settimana fa | |
rtb_state_5.dot | 1 settimana fa | |
rtb_state_5.png | 1 settimana fa | |
sendMessage.png | 1 settimana fa | |
vending.dot | 1 settimana fa | |
vending.png | 1 settimana fa | |
window_complex.dot | 1 settimana fa | |
window_complex.png | 1 settimana fa | |
window_state.dot | 1 settimana fa | |
window_state.png | 1 settimana fa |
This is a web-based article describing cooperative multitasking, also known as event driven programming. The method described here is small enough to fit on many sub-$1 microcontrollers, those without memory management units. Examples are the STM32, STM8, PY32, AtMega, AtTiny, 8051 and Pic microcontrollers.
With this code structure in place, these tiny microcontrollers can be made to perform multiple separate tasks, apparantly independent from each other.
The reader is walked through the elements of the build, and is then given a fully-implemented block of code. The 2nd half of the article builds on the basis, with lots of examples of state-machines and modifications to allow for cleaner code.
The audience for this article is anyone interested in writing code for small micro-controllers. A background in any programming language would help (C, Rust, Python).