4 ms·
What frustrates me about arduino is how limited the peripherals are. I can see why they chose to begin with that obsolete processor - the arduino model of progr
by blutack 5y ago
What frustrates me about arduino is how limited the peripherals are. I can see why they chose to begin with that obsolete processor - the arduino model of programming is simple & approachable precisely because the processor is so dumb (no complex interrupt controller, no DMA, no complex power gating and clocking setups).
For reliable embedded software I try and get the peripherals of the microcontroller to do all the timing critical work and my code sits up at a high level handling complete messages etc. Kind of the equivalent of "not blocking the event loop" in node, or functional vs imperative programming.
But the arduino libraries etc don't really fit well with this style, because they have to accommodate lowest common denominator chips like the ATMega. At least it's not PIC 8s I suppose...
For getting into embedded, I would strongly recommend the Teensy series (the 4.1 is joyful overkill for virtually any project). They are far more functional processors which are supported very well by the arduino ecosystem and have their own excellent set of libraries maintained by Paul which make full use of the hardware in the MCU. Being ARM based means that on chip debugging is relatively painless if it comes to that.
- marcan_42 5y agoThe beauty of using such a simple MCU is that it is very easy to learn how to program it directly... ... and yet Arduino isn't actually teaching people how to do that :( I'm a staunch proponent of using up to date MCUs, which means ARM these days, but I'd be completely on board with still using an ATMega as the default in 2022 for this kind of educational purpose if the point were actually being educational. At least it's not a PIC16F84, I suppose. All the microcontroller books spent a decade teaching literally the lowest end, crappiest, and more expensive PIC in the series because it was the first model with Flash memory, and ignoring everything that came after it. Even those that were backwards compatible for all intents and purposes, and not any harder to incrementally learn.