Live data from Hacker News

Introducing multitasking to Arduino

blog.arduino.cc

71–80 of 88 posts

Re: Introducing multitasking to Arduino

#71
In Rust there is https://embassy.dev which is an async Rust framework for embedded. It has been shipping in products for years. Can be made real-time (for some definitions of it).

There is also RTIC https://rtic.rs which is a concurrency framework for real-time systems using interrupts. IIRC the car industry is interested in it.

Re: Introducing multitasking to Arduino

#72
post #68

Earlier quoted context omitted.

I think AVR is a good architecture to learn on, because the devices are far simpler than ARM or other more modern chips. The main concept to master as an embedded developer is operating a device by its registers. The common arduino device, ATMEGA328, has a total of 84 registers across all peripherals. A simple program to blink the LED is less than 10 lines total. The datasheet is tiny compared to most ARM devices, bu…

That was true when one had to write assembly code. Now we don't really have to any more, thanx to Arduino mainly (which bilds upon avrgcc and avrdude). It's easier to learn on the new platforms because you can use higher level programming languages like MicroPython, especially for easy stuff. I can do a blinky by writing three lines in the uPy REPL.

If the registers are abstracted away, you're left relying on other people's code. I suppose learning microcontrollers can mean different things to different people, but as for becoming a professional embedded developer, micropython and Arduino are dead ends. There is no transition to truly understanding the hardware.

Re: Introducing multitasking to Arduino

#75
post #68

Earlier quoted context omitted.

That was true when one had to write assembly code. Now we don't really have to any more, thanx to Arduino mainly (which bilds upon avrgcc and avrdude). It's easier to learn on the new platforms because you can use higher level programming languages like MicroPython, especially for easy stuff. I can do a blinky by writing three lines in the uPy REPL.

If the registers are abstracted away, you're left relying on other people's code. I suppose learning microcontrollers can mean different things to different people, but as for becoming a professional embedded developer, micropython and Arduino are dead ends. There is no transition to truly understanding the hardware.

This is subject to change, as embeded developers now focus on writing lower or higher level code mainly in C/C++ as the industry migrates away from 8-bit MCUs to 32-bit ARM and RISC-V. Of course you're relying on other people's code, as you can't expect everyone to write their own RTOS and standard library and also achieve an acceptable time to market. Most embedded hardware products use an existing RTOS and build upon it. Understanding how the hardware works always helps, but most of the time you don't have to dig to register level to do that.

Micropython and Arduino are not dead ends but hobby grade tools.

Re: Introducing multitasking to Arduino

#76
post #71

In Rust there is https://embassy.dev which is an async Rust framework for embedded. It has been shipping in products for years. Can be made real-time (for some definitions of it). There is also RTIC https://rtic.rs which is a concurrency framework for real-time systems using interrupts. IIRC the car industry is interested in it.

Very interesting projects.

Looking at the documentation and Github pages it's not very clear if ATmel, the microcontroller family for Arduino, is supported at all or not.

Do you have a link where this is validated?

Re: Introducing multitasking to Arduino

#78
post #71

In Rust there is https://embassy.dev which is an async Rust framework for embedded. It has been shipping in products for years. Can be made real-time (for some definitions of it). There is also RTIC https://rtic.rs which is a concurrency framework for real-time systems using interrupts. IIRC the car industry is interested in it.

Very interesting projects. Looking at the documentation and Github pages it's not very clear if ATmel, the microcontroller family for Arduino, is supported at all or not. Do you have a link where this is validated?

There are several microcontroller architectures within the Arduino family officially as well as compatible ones that are also called Arduino-something.

The classic (and oldest) are the AVR microcontrollers (ATmega), which are not supported by embassy nor rtic at the moment AFAIK. They are supported by Rust, though. see: https://github.com/rahix/avr-hal.

However, there are several other Arduino microcontrollers that are supported. For example the Arduino Nano RP2040, Arduino Nano 33 BLE (nRF), the Arduino MKR ones as well as the STM32duino (STM32F103, the one in the hugely popular $2 blue-pill boards) are all based on the ARM cortex-m architecture, which is supported by both embassy as well as rtic.

For espressif chips (like the esp32), support is being worked on by the manufacturer itself: https://github.com/embassy-rs/embassy/issues/745

Here an overview of microcontrollers in the (official) Arduino family: https://www.makeuseof.com/exploring-different-types-of-ardui...

Re: Introducing multitasking to Arduino

#79

Earlier quoted context omitted.

where? where can i get one?

Well, there's a "hardware" link at the top of the linked article for starters. Or google "esp-32" to find store selling a very popular one. Or check out what's available on sparkfun or adafruit.

I’m a fairly loyal customer of adafruit. I really like their stuff and I’m not ashamed to say I really like circuit python. So much of embedded work is writing drivers and circuit python has many many already written and ready to go.

Re: Introducing multitasking to Arduino

#80
post #68

Earlier quoted context omitted.

That was true when one had to write assembly code. Now we don't really have to any more, thanx to Arduino mainly (which bilds upon avrgcc and avrdude). It's easier to learn on the new platforms because you can use higher level programming languages like MicroPython, especially for easy stuff. I can do a blinky by writing three lines in the uPy REPL.

If the registers are abstracted away, you're left relying on other people's code. I suppose learning microcontrollers can mean different things to different people, but as for becoming a professional embedded developer, micropython and Arduino are dead ends. There is no transition to truly understanding the hardware.

We use MicroPython commercially so my perspective is different. :) I do agree with your intent though; just because you're using a high-level language it doesn't excuse you from learning how the hardware works.

However, if you do know the hardware, if you are familiar with what's going on under the hood, then MicroPython allows you to write the majority of your system significantly faster.

Post reply on HN