A Fundamental Implementation Change

Traditional Arduino boards, like the Uno R3 or Nano, are typically programmed using the Arduino Library functions. These conveniently present most of the microcontroller’s functionality to the hobbyist user. Books like my Far Inside The Arduino and the microcontroller’s documentation show how to access additional functionality not addressed by the Arduino Library.

As more advanced microcontrollers made there way into Arduino products, the same library functions were provided. Arduino, the company, always wants to maintain compatibility with earlier boards, even at the expense of not making use of new features. This can be found in the ATmega4809 in the Nano Every and in the numerous SAM boards like found in all the MKR series boards and others.

But the newest boards have taken a different approach. The Arduino Library no longer accesses the hardware registers directly but instead calls microcontroller vendors’ libraries. This inserts an extra layer of software. The vendors don’t want the hardware to be accessed directly, but instead through their libraries. This gives portability at least among the vendors different microcontroller products. This can be seen with the boards using the Mbed OS. This includes the Nano RP2040 and 33 BLE and Portenta, among others. Also with the new boards using Renesas microcontrollers like the Uno R4, and with the ESP32 equipped boards like the new Nano ESP32.

There seems to be performance issues especially with the Uno R4 boards. There are reports of slow SPI and I’ve found the WiFi communication to be particularly slow as well as flaws with the EEPROM library that will lead to early death of the part.

The Nano ESP32 seems to be somewhat different here. The Arduino Library files all carry an Espressif copyright (instead of an Arduino copyright). I am lead to believe that the microcontroller vendor implemented the library. I particular like the Nano ESP32 because of it’s low cost and performance. It has a very large available program memory. The bulk of the library functions are in an on-chip ROM.

The downside is that this is proprietary. So far I have been unable to find access to the sources or a low level (hardware) description to be able to directly access the hardware registers. On the upside is that FreeRTOS is part of the ROM and the library functions seem to be fully FreeRTOS aware and compatible. This makes this board the highest level available. Multitasking should eliminate the desire to write interrupt driven programs. I’m looking forward to playing with this board.