by aulin · 3y ago · 0 comments
Arduino is a great onramp to embedded, but it really needs an offramp.
I also have several smart plugs from different vendors, smart bulbs, one thermostat, a camera, all still using esp8266 and doing just fine.
They are also like $2 a pop for whole breakout board and less if you make actual device.
I do agree if you just want to tinker the tiny extra for ESP32 is probably worth just for tinkerer but there is still a plenty of devices (in IOT space mostly) that are just "ESP8266 + some peripherals" and thus nice and hackable
"Original" Arduino on the ATMega8 is fully obsolete and should be moved off of. Fortunately, it wasn't that popular.
"Arduino Uno" (which popularized the Maker movement in 2010) with ATMega328 is also obsolete. You should use ATMega328pb at a minimum (but even then, the 328pb is nearly a decade old now...), or really the AVR DD chips that are cheaper, faster, simpler, more powerful. Ex: AVR64DD32
To explain how absurd it is... the AVR64DD32 uses 4.7mA at 24MHz fully active.
In contrast, the old ATmega328 uses 12mA at 20MHz (its limit), and 3.5mA while idle (aka: 1st level of sleep).
So an idle (1st sleep) ATmega328 uses basically the same power at a fully active AVR64DD32. Indeed, AVR64DD32 only uses 500uA (microAmps) at 4MHz fully active, so it can "busy loop" with less power than a sleeping ATmega328.
AVR64DD32 costs $1.67 at lot size 1 from Digikey. ATmega328 costs $2.73 for lot size 1 from Digikey.
ATmega328 comes with 32kB of Flash and 2kB of RAM. AVR64DD32 comes with 64kB of Flash and 8kB of RAM. It completely dominates the older chip in every possible regards.
------
Original Arduino Uno is still a great learning tool. But there have been over 10+ years of improvements to these chips. Anyone actually dipping down into AVR programming should prefer the newest chips.
IMO, Arduino Uno should be seen as a learning tool. Fortunately, all of the stuff (ex: Assembly language, sleep modes, etc. etc.) still apply to the AVR64DD32. The peripherals have changed though... USART rather than UART. DAC included, OpAmps in AVR64DB32, etc. etc. Integrated dual-power supply on AVR DD chips (PortC can be on a 2nd voltage level, so its basically an integrated level-shifter). Full 24MHz speed at 1.8V (ATMega328 has this annoying "derating" curve, where 1.8V can only handle 4MHz).
But no one should be using ATmega328 in new "serious" designs. Its just "still" useful because all of those old tutorials from 10 years ago still work today. So it has the most tutorials written for it, and should remain "steady" as a learning platform.
But anyone taking the next step (learning the actual chip, learning how to solder, learning how to breadboard), needs to switch to the newest chips. The newest stuff is just cheaper, faster, and easier in practice. And still _mostly_ compatible with the old ATMega328 (same assembly language. A superset of the features. Similar concepts in layout / design, etc. etc)
Is there any actual benefit over just going for some Cortex M0 aside from "run old stuff on it" ?
I started my adventure with AVRs and avr-gcc, played a bit with arduino but nowadays there doesn't seem to be a good reason to pick them, M0s and M3s are cheap and plentiful and usually better specced for the price
I couldn't agree with you more.
I work with artists who build great teetering cathedrals on top of Arduino(and Processing), and it's really difficult to incrementally move to a more serious solution once things have reached a certain level
Specifically the things it does that bake in bad habits are:
- Encouraging globals
- Everything in one namespace
- Arduino is not C++
- not needing pre-definitions(mostly) and spamming all .pdes into the same file leads to tangled code that's really hard to pull apart into modules, even if it's separated in tabs in the Arduino editor
- delay: not composable!
- for esp specifically: Thinking in terms of a single loop function Vs multiple rtos threads
- the ide is terrible, and encourages a copy-paste workflow because that's how best to work within it
How so?
Does it?
PIC-BASIC was the great onramp like 20 years ago. It never got an offramp. Arduino just did it better / simpler, and all the hobbyists switched to that.