Interrupt races
A hard interrupt counts a 1 kHz wheel sensor. Put a little work in the wrong place and ticks vanish: a real race, measured.
Open it in the simulatorConcurrency on one core in MicroPython on a Pico: superloops, interrupt races measured for real, critical sections, coroutines, asyncio, queues, and a responsive multi-sensor box.
0 of 7 done
7 lessons in 4 chapters, about 5 hours on a simulated Raspberry Pi Pico. Free, in your browser, every step checked by the simulator.
A hard interrupt counts a 1 kHz wheel sensor. Put a little work in the wrong place and ticks vanish: a real race, measured.
Open it in the simulatorA ring buffer an interrupt can fill without allocating, what happens when the consumer is too slow, and a queue class with backpressure for tasks.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
From a blocking loop to a superloop, then interrupts and the race they bring.
Why one sleep() ruins a two-job program, and the superloop that fixes it: timestamps, ticks_diff and a debounced button.
0 of 5 steps
A hard interrupt counts a 1 kHz wheel sensor. Put a little work in the wrong place and ticks vanish: a real race, measured.
0 of 5 steps
Critical sections, the no-memory rule of hard interrupts, and micropython.schedule.
Close the race for good with disable_irq, measure how long interrupts stay off, then meet the rule hard interrupts live by: no new memory.
0 of 5 steps
Generators as coroutines, a scheduler by hand, asyncio, and queues with backpressure.
Generators are functions that pause. Build a round-robin scheduler, then one that sleeps: the engine inside every async library.
0 of 5 steps
Tasks with async and await, the blocking mistake that freezes them all (measured), and a hard IRQ waking a task through ThreadSafeFlag.
0 of 5 steps
A ring buffer an interrupt can fill without allocating, what happens when the consumer is too slow, and a queue class with backpressure for tasks.
0 of 5 steps
A multi-sensor box that never stops answering, with its lag measured.
Everything at once: an IRQ-counted wheel with a critical section, a smoothed knob in slices, a flag-driven button, a heartbeat, an alarm and a lag watchdog.
0 of 6 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Concurrency: tasks, races and async are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Raspberry Pi Pico with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Interrupt races and Queues.
With "Doing two things", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.