4 ms·
That is spiritually what their Scheduler library is doing, as mentioned in the article. Which works for a lot of things just fine until one task begins to overr
by joezydeco 4y ago
That is spiritually what their Scheduler library is doing, as mentioned in the article. Which works for a lot of things just fine until one task begins to overrun its time slice or just hangs. And then you're looking into preemption.
But if you're overruning an AVR micro maybe it's time to take the training wheels off and move up to a larger system.
- jgerrish 4y agoDon't be too quick to dismiss the "training wheels" of AVR. While ARM and RISC-V may have beefier processors, and will probably be migrated to or adopted, AVR has a lot going for it. First, a common AVR board like the Arduino Uno has built-in peripherals like a temperature sensor. You can build something out of the box without buying external items. If your target market is cheap educational, that's key. Second, it offers basic microcontroller features like power management, external interrupts, serial and other stuff. It provides a terrific cheap platform to understand managing interrupts and concurrency safely in your language of choice. Which can be applied to the bigger boards. Finally, memory constraints require careful thinking through code. I'm not going to implement a full standard library on an Arduino AVR, so what do I bring with me?
- HeyLaughingBoy 4y ago> move up to a larger system I'll take this one step further and suggest that beginners not start with the AVR, but instead with a Blue/Black pill (STM32) or ESP32. Leave the AVR for the more advanced people who are trying to squeeze every penny out of a project (even there, in many cases STM32 will cost less!!!). I visit the arduino.cc forums at least once every day and the things that beginners want to do these days is far more advanced than what they would have attempted even 10 years ago. It gets very difficult trying to explain how to do things on an AVR that would be much easier on a processor with far more resources. String vs char* is one of those. Hell, I don't know why we're even telling beginners to code in C++ in 2022. My downvoted comment that boils down to "just use an ESP32 and get FreeRTOS along for the ride" is in this vein. The reality is that beginners have a lot of trouble wrapping their heads around writing nonblocking code using timers and something like a FreeRTOS thread is a much simpler concept to explain. Rant over :-)
- joezydeco 4y agoI hear ya, I think we're just in a different era now. Users can wrap their head around a precooked framework that's ready to go and only needs a few API calls to make something happen. Beyond that? That's homework and homework sucks. FreeRTOS really isn't that large of a leap forward, in fact when it's done right on your target platform it's just a few API calls as well. But it means wrapping your head around a lot of detailed concepts (stack size? semaphores?) when all you want to do is light up that string of RGB LEDs.
- RealityVoid 4y agoStack size is a thing on Arduino as well.
- Teknoman117 4y agoIt's funny - I stepped away from electronics when I started college and in the first few years out of it just due to not having enough free time. About a 10 year period. I come back and now AVR is old and slow and ARM is hot stuff. All it took was the tooling becoming nearly free. No more $500 ISP programmers, just USB DFU boot.
- sitzkrieg 4y agoyea, usb dfu, better tooling and the price is nearly interchangeable. heck, small PDIPs are sometimes more expensive and less stocked
- Teknoman117 4y agoI remember the first ARM board I got back in like 2008 required some Keil IDE which was >$1k for hobbyists and only had a 30 day evaluation included in the kit. Made by a company called Luminary Micro iirc. Builtin programmer was locked to only work with that specific chip. Never seriously considered ARM for a long while after that.
- dekhn 4y ago