5 ms·
If you must use ESP8266 for some reason, then completely agreed. ESP8266 is obsolete now though, there are far more capable ESP32 variants, some of them specifi
by HuwytGreen 4y ago
If you must use ESP8266 for some reason, then completely agreed. ESP8266 is obsolete now though, there are far more capable ESP32 variants, some of them specifically designed and marketed to replace the 8266 and to make transition as easily as possible. Not to mention the benefits of a now quite mature ESP-IDF SDK.
Arduino is a great onramp to embedded, but it really needs an offramp.
- ilyt 4y agoThat's a very ignorant statement; they are still in production and entirely enough for many use cases, just like original arduinos are. 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
- dragontamer 4y ago> just like original arduinos are. "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)
- ilyt 4y agoI wasn't being clear enough, I meant "over just picking some ARM part". 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
- dragontamer 4y agoThe old ATMega328 is obsolete. That's my point. There's a ton of chips that are better than ATMega328. But if we're talking about _MODERN_ chips, like AVR64DD32, the modern successor to ATMega328, with AVR assembly language, GCC support and all that jazz... EDIT: AVR64DD32 is basically a "modern ATMega" btw. Its not an ARM, its an AVR processor. Is this the point of confusion? * Running directly off of 5V USB power without any voltage regulators is a neat trick. No ARM Cortex M0+ part I'm aware of goes above 3.6V (they're designed for Li-ion cells). Dropping down to 1.8V is also a neat trick, the AVRs have a very wide practical range of voltages. * Dual power supply. PortC of AVR64DD32 runs off a 2nd power supply. So the AVR64DD32 can run off of 5V USB power, and with an external LDO regulator can have PortC running 3.3V. (Aka: integrated level shifter). You know, for all of that annoying 3V crap that you need to integrate with 5V other crap. * The big-brother, AVR64DB32 (the DD turns into DB. Confusing, yes, I know), has 3x OpAmps. Meaning you don't even need a power supply anymore. You can power PortC / secondary I/O lines from the integrated OpAmps on the AVR-DB. -------- I'd say typical M0+ parts are at the $2.50-ish price point. AVR DD has some neat tricks, and scales down to under $1 in bulk ($1.09 for 1: https://www.digikey.com/en/products/detail/microchip-technology/AVR16DD14-I-SL/16643845 https://www.digikey.com/en/products/detail/microchip-technol...) If you upgrade to the bigger AVR DB in the series to $2.00 to $3.50... you get 3x rail-to-rail OpAmps with integrated resistor ladders and suddenly you're in a very flexible mixed-signal world. I think STM32G4 chips have integrated OpAmps. But these are $7+ chips and a ARM Cortex-M4 (much more expensive / complex / bigger than the M0). > M0s and M3s are cheap and plentiful and usually better specced for the price Which one? AVR64DD32 is 64kB of Flash and 8kB of SRAM for $1.60. Cheapest STM32L0 I can find is $1.82 and only has 2kB of SRAM. And it doesn't go to 5V, doesn't have integrated level shifters, op-amps, or any of the other neat tricks... (And STM32L0 is a _very_ competitive Cortex-M0+ line in my experience). Like, we all want to just code our way out of problems. But sometimes, you have a 3V thing that you need to connect to a 5V thing. And AVR DD is the perfect tool for that. ------ EDIT: Ah right. And ATMega328 can still sink 20mA to fully turn on an LED without any MOSFETs / external amplifiers. I think PIC is the only other major line of chips that has this feature. AVR-line is legendary for its current source / current sink strength.
- dragontamer 4y ago> Arduino is a great onramp to embedded, but it really needs an offramp. 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.
- aulin 4y agoI for one still have plenty of esp8266 based nodemcu/wemos around the house, they still do just fine for most hobbyist purposes and the RTOS SDK is just as pleasant to use as ESP-IDF. Most of the API is the same and they have example code for almost everything. I also have several smart plugs from different vendors, smart bulbs, one thermostat, a camera, all still using esp8266 and doing just fine.
- shirleyquirk 4y ago>needs an offramp 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
- dekhn 4y agoUse Platform IO (I use it inside Visual Studio Code). It's C++. You don't have to use globals. .pde is processing, it's not required to use that (I write python scripts that talk over serial instead). ESP32 in Arduino supports multiple threads (cores).
- yjftsjthsd-h 4y ago> Arduino is not C++ How so?
- toast0 4y agoNodemcu's lua is a reasonable option too. In terms of offramps, platform.io can get you moving towards the doors anyway. I haven't used it with esp8266, but on ESP32, you can switch between arduino and esp-idf; of course, if you use arduino components in your build, you still need them; you can use arduino as a component in esp-idf. It's a little fiddly, but I could see replacing components bit by bit until you run out of Arduino.