I'm back on track for pondering how to Do Arduino Right. Watching the "Maker" community struggle with the limitations of that environment and reaching for an RPi instead (which is like being frustrated using a tricycle to go cross-country so reaching for a Ferrari instead) always gives me the urge to design something better.

The first thing to address is hardware: use a modern, but simple MCU like something from the Cortex-M0/M0+ family. Given my own work experience I'd go with an STM32 …

… of some form, likely in the L0 line. Maybe the G0. There are other capable MCUs in Cortex-M0/M0+ space, however, so the key is not to tie yourself into one vendor with your design. Instead make a hardware design that can be easily backed by any MCU with suitable peripherals.

And that segues neatly into the next issue: interfaces. I'm a huge fan of Grove or Grove-adjascent connector styles. They're a good way to easily group and connect peripherals in pre-arranged ways that walk that …

… narrow line between "dumbed down" and "painfully prone to hard-to-diagnose hardware problems". A picture of an actual board I own (an older one for the ESP8266) shows what I mean.

THIS is what I think an "Arduino Done Right" should look like.

Of course this leads to the issue of software. There are three things to deal with here:

1. Software for beginners.
2. Software for experts.
3. Bypassing the default software entirely.

Beginners should be faced with a high level language …

… that is small enough to not require huge, beefy MCUs to run (which leaves out JavaScript), that has a "common"-enough syntax that skills easily transfer to more "professional" tools (which leaves out Forth, Tcl, and a few other such weirdo languages which would otherwise be a perfect fit), but that also has a powerful FFI that makes enhancing it with low-level features easy (which Tcl would be perfect for, but for its weirdness).

This leaves, frankly, only Lua left of the languages I use. …

… Lua has a fairly conventional syntax (more Pascal-ish than C-ish) and, as long as you don't poke around in its more advanced weirdness also has pretty basic semantics. You can become a competent and productive user of Lua with an afternoon's introduction if you're familiar with any other imperative programming language, and maybe with a week's instruction and tinkering if you're not a coder.

That being said, we need more than just a language. We need an *environment*. This is where …

… Arduino has excelled compared to its alternatives. The Arduino has an acceptable IDE, and excellent facilities for programming and debugging live programs. Non-Arduino embedded programming is a major chore with a lot of concepts to get through your head like JTAG/SWD/whatever adapters, debug servers, debuggers, flash loaders, memory layouts, etc. This forms a huge barrier that has stopped people I know from progressing beyond that point. It's too difficult. Too alien. In a word: scary.

Whatever environment an Arduino Done Right has, it will have to be able to almost transparently load and run user scripts without monkeying around with debugger interfaces. (This likely means that a CMSIS-DAP needs to be on the board and the environment needs to know how to talk to it over USB.) It should also be able to easily reconfigure the runtime (Lua has a lot of dials you can adjust) and reflash it with a single pushbutton. Debugging scripts needs to be easy and GUI. It, in short …


… has to be everything that serious embedded programming isn't.

And then it has to work as well with lower-level modules that interface with the Lua environment so that fancier things, or higher-speed things, or more reliable things can be build in a language like C or Ada or whatever. These must be easily wrapped (no exposing the Lua FFI unless the user specifically asks for it--good frameworking is needed here), pushbutton-flashed, ideally as partial uploads into an existing system, …

… and again easily (no, TRIVIALLY) hooked into the debugger.

This is all a very tall order, I know. But it's needed.

So now you know my Dream Project™ that I would like to create in my Copious Free Time™. With only one final step to consider: licensing.

I'm partial to WTFPLv2, myself.


Sign in to participate in the conversation

Generic Mastodon server, open for registrations.