Important news about HackSpace

We have some important news to share about HackSpace: Issue 81 was the last issue of HackSpace as a standalone magazine, and HackSpace has become part of The MagPi, the official Raspberry Pi magazine. Starting with issue 145, We’ll be adding pages to The MagPi to make room for the stories and tutorials you’ve come to expect from HackSpace.

Adafruit Grand Central M4 Express review

By Ben Everard. Posted

There’s no shortage of microcontrollers built in the Arduino form factor. However, almost all of these are built in the style of the Uno. The Mega form factor (with its vastly expanded range of IO pins) has seen only one significant insurgent in the last nine years – the Arduino Due, which, despite some advantages, never became popular. However, this has now changed with a new board supporting a large number of IO pins: Adafruit Grand Central M4 Express.

This board houses an impressive 54 digital IO pins and 16 analogue inputs (two of which can be used as analogue out via a 12-bit DAC).

There are a few clues about the processing power of this board in its name. M4 refers to the version of the ARM core on the board, while Express – in Adafruit terminology – means that there’s more than 2MB flash space (there’s actually 8MB). You can fit a lot in 8MB, but if that’s not enough, there’s also a microSD card slot, so you can pile (almost) as much data as you like into storage.

The M4 core runs as 120MHz, and has both hardware DSP (digital signal processing) and floating point support. It’s a little hard to compare the speed of different microcontrollers because there are a lot of differences in the underlying silicon, as well as the speed it runs at. Floating point can be really slow on some microcontrollers, so the speed-up may be much faster than the numbers alone may suggest.

To test how much faster, we compared this board to a Circuit Playground Express, which has an M0 core running at 48MHz (this is a fairly quick microcontroller by many standards) without a floating point unit. Using the Arduino IDE, we programmed this to perform a million integer multiplications and a million floating point multiplications. On the CPX, this took 189 milliseconds for integer, and 8308 milliseconds for floating point.

On the Grand Central, the integer operations took 67 milliseconds – which is about in line with the expected speed-up, as the core is 2.5 times faster and slightly more powerful. The floating point operations took 75 milliseconds – only slightly slower than the integer operations. As well as floating point, the M4 cores have hardware support for integer divide, with a similar speed-up of about 40 times. This speed means that the Grand Central can be pushed into areas that many microcontrollers just can’t cope with – such as audio manipulation, and calculating complex LED patterns.
The DSP can provide a huge speed boost, however, using it isn’t easy. Unless you’re interested in diving down into the minutiae of compiler optimisation, it’s probably only going to be relevant if you’re using libraries that support it. The most popular example of this is the Audio Library originally designed for the Teensy (the Teensy 3.x also use an M4 processor). As M4 processors become more widely used, more libraries supporting the DSP are likely to be created.

grand central 2

The form factor – as we mentioned at the start – is based on the classic Arduino Mega, which is an extension to the Arduino Uno, and this means that there are a range of shields already available. Like most modern microcontrollers, the Grand Central is a 3 V board, so you need to make sure that any shields are compatible with this voltage.
The Grand Central has a huge amount packed into it, but all microcontrollers are about compromise – you simply can’t make a board that has it all, especially when ‘all’ often includes small size and low price. The most obvious compromise on the Grand Central is the lack of any wireless connectivity – there’s neither Bluetooth nor WiFi. This doesn’t mean you can’t use it wirelessly, but you will need extra hardware, which means extra cost and complexity.

A soft touch
On the software side of things, both Arduino and CircuitPython are supported, but Adafruit has this to say: “We have a working Arduino board support package, with lots of stuff working, but our primary target for this board is CircuitPython”.

While this does sounds a little pessimistic on the Arduino front, it does need to be taken into account compared to Adafruit’s usual excellent support. For most uses, the Arduino environment should work as expected, just don’t expect loads of libraries and examples targeting the more esoteric features of the board, such as the PCC camera interface.

CircuitPython using Mu requires version 1.0.2 or later to detect the serial connection, and works as expected. There are already official guides for creating a soundboard and a MIDI interface.

The Grand Central M4 Express packs a huge amount onto a microcontroller board. There’s enough IO to control almost anything, and the processing power to crunch through the massive amount of data it’s capable of bringing in. As the name suggests, it’s not the smallest board, but if you’ve got the room, this is a great brain for IO-hungry projects.

Adafruit $37.50 adafruit.com

VERDICT
Inputs, outputs, and processing power galore. This is a great board for complex controls and interfaces.
9/10


https://hsmag.cc

From HackSpace magazine store

Subscribe to our newsletter