SAMD21 Anyone? The Future of Arduino?

So I just finished the Still Far Inside The Arduino book and am starting to consider a new project. The Arduino Nano 33 IoT caught my eye. While still a bit more expensive than clone Uno or Nano boards, it is the second lowest cost genuine Arduino board, second only to the Arduino Nano Every. It should be strongly considered for use based on price alone! Let’s consider some of the features of the board.

I interrupt this post to say if you haven’t done so, please buy my Arduino books! For some reason sales fell off when I introduced my new book. I expected sales to go up. I don’t live off of the sales, but it provides a nice little bonus in my retirement.

It uses a Microchip/Atmel SAMD21G18 microcontroller. Features:

  • 32-bit Arm Cortex M0+ processor running at 48MHz. So several times faster at a minimum.
  • 256KB flash program memory, 8 times more than a Uno
  • 32KB RAM memory, 16 times more than a Uno
  • Like seemingly all Arm based microcontrollers, no EEPROM. But you can always use an external part
  • A large number of peripherals, most features of which are not accessible with Arduino library because they really want to be Uno compatible. And I feel that the attempt to be compatible is really straining the Arduino framework. The library is really becoming a mess!
  • If you look at the differences between the ATmega328P and the ATmega4809, the SAMD looks much more like the 4809. What ever axis they are on, the SAMD is about an equal distance further along than the 4809.
  • Runs at 3.3V which can be a problem if you external devices are 5V.

The Arduino board product line for hobbyists is 20 products. Eight of them use AVR microcontrollers. Two use an nRF52840 with a built-in BLE radio. One uses the RP2040, basically a Raspberry Pi. One uses a SAM3X8E, an old chip but the board (the Due) is probably the most powerful of the bunch. The remaining eight use the SAMD21.

Of these, one is in the Uno form factor, the Zero. The Nano 33 IoT is in the Nano form factor. The remaining six are in the MKR form factor and differ in the radios but for the Vidor 4000 which has an FPGA.

The Nano 33 IoT has a NINA Bluetooth/WiFi radio module, an inertial sensor, and a crypto chip. Sadly, in terms of me writing a book, the crypto chip data sheet is only available via a Non Disclosure Agreement. So as interesting as it might be it must be treated like a “black box”. The other modules are documented fully. As usual, the Arduino board itself is only really documented by the source code being freely available.

If you want a “clean” SAMD21 board without the modules your only option is the Zero, at twice the price! The microcontroller has six Serial Communication Interfaces (SERCOM) that can be used as I2C, SPI, or USART. Two of these are reserved for the NINA interface. Three provide the standard I2C, SPI, and Serial1 interfaces (there is also a USB Serial interface), however two I2C addresses are taken by the crypto and inertial modules. This leaves one unassigned SERCOM that can be used as a second I2C, SPI, or USART. Frankly this doesn’t strike me as particularly limiting, and definitely better than most of the AVR based Arduino boards.

So I’m now going to spend some time going deep inside. It doesn’t help that the SAMD21 boards have several different connections between board pins and microcontroller pins. This means that one “Rosetta Stone” doesn’t handle them all. The Arduino library “solves” the problem by having a big table for each board that lists the connections and capabilities of each board pin. Hey, that’s basically what my Rosetta Stone table is!