ANTIRTOS: No RTOS Needed

Embedded programming is a tricky task that looks straightforward to the uninitiated, but those with a few decades of experience know differently. Getting what you want to work predictably or even fit into the target can be challenging. When you get to a certain level of complexity, breaking code down into multiple tasks can become necessary, and then most of us will reach for a real-time operating system (RTOS), and the real fun begins. [Aleksei Tertychnyi] clearly understands such issues but instead came up with an alternative they call ANTIRTOS.

The idea behind the project is not to use an RTOS at all but to manage tasks deterministically by utilizing multiple queues of function pointers. The work results in an ultra-lightweight task management library targeting embedded platforms, whether Arduino-based or otherwise. It’s pure C++, so it generally doesn’t matter. The emphasis is on rapid interrupt response, which is, we know, critical to a good embedded design. Implemented as a single header file that is less than 350 lines long, it is not hard to understand (provided you know C++ templates!) and easy to extend to add needed features as they arise. A small code base also makes debugging easier. A vital point of the project is the management of delay routines. Instead of a plain delay(), you write a custom version that executes your short execution task queue, so no time is wasted. Of course, you have to plan how the tasks are grouped and scheduled and all the data flow issues, but that’s all the stuff you’d be doing anyway.

The GitHub project page has some clear examples and is the place to grab that header file to try it yourself. When you really need an RTOS, you have a lot of choices, mostly costing money, but here’s our guide to two popular open source projects: FreeRTOS and ChibiOS. Sometimes, an RTOS isn’t enough, so we design our own full OS from scratch — sort of.

Modular Magnetic LED Matrix

[bitluni] seems rather fond of soldering lots of LEDs, and fortunately for us the result is always interesting eye candy. The latest iteration of this venture features 8 mm WS2812D-F8 addressable LEDs, offering a significant simplification in electronics and the potential for much brighter displays.

The previous version used off-the-shelf 8×8 LED panels but had to be multiplexed, limiting brightness, and required a more complex driver circuit. To control the panel, [bitluni] used the ATtiny running the MegaTinyCore Arduino core. Off-the-shelf four-pin magnetic connectors allow the panels to snap together. They work well but are comically difficult to solder since they keep grabbing the soldering iron. [bitluni] also created a simple battery module and 3D printed neat enclosures for everything.

Having faced the arduous task of fixing individual LEDs on massive LED walls in the past, [bitluni] experimented with staggered holes that allow through-hole LEDs to be plugged in without soldering. Unfortunately, with long leads protruding from the back of the PCB, shorting became an immediate issue. While he ultimately resorted to soldering them for reliability, we’re intrigued by the potential of refining this pluggable design.

The final product snapped together satisfyingly, and [bitluni] programmed a simple animation scheme that automatically updates as panels are added or removed. What would you use these for? Let us know in the comments below. Continue reading “Modular Magnetic LED Matrix”