3

(coco) #1
M

PICKING


THE Perfect


FEATURE


Picking the perfect microcontroller


about the hardware you might need to use them. USB
boards simply require an appropriate cable (watch out
here, you may find a few with the now uncommon
mini-USB), but serial boards will require some form of
serial interface. This is most often a USB-to-serial board
or cable that can be had for a few pounds, but in some
cases it can be a proprietary interface that may carry a
more significant cost. It is worth investigating this
before making your choice.
So, you’ve got your eye on a
processor and you know what
hardware you’ll need to
program it. Now it’s worth
turning to their software
environments. This may
influence your choice of
platform more than the
processor architecture or the

manufacturer, because you may have a familiarity with
a particular language or IDE.
Traditionally a microcontroller will come with an
associated software toolchain from its manufacturer,
with an IDE in which you write your code, and a
compiler which turns it into a binary file and sends it to
your board. These are typically proprietary packages, and
the language in question will often be some dialect of C
or C++. Using these environments gives you the
maximum access to the capabilities of the chip, but will
often require a detailed knowledge of the chip
architecture for tasks such as configuring the functions
of each pin.
The Arduino IDE and bootloader combo is another
C-based environment, but one that simplifies this by
abstracting many of the difficult tasks associated with
microcontroller configuration. Instead of having to
consult the data sheet and write code to set a particular
pin as a PWM output or an analogue input, a standard
pin configuration is set up and provided through an
easy-to-use software library. The Arduino IDE is now
supported by a vast number of boards, including many
that aren’t made by Arduino. Because it is an open-
source platform, there are many plug-ins to allow it to be
used with other non-Arduino boards. It is often a
sensible choice to use the Arduino IDE, even if you don’t
have prior knowledge of it, because there is a huge body
of online code as well as help and advice about it, and it
is a skill transferable to other platforms.

CHEAP AND CHEERFUL:
THE CAPABLE ESP

The ESP8266 made a significant splash
when it arrived without warning and with
very little documentation in 2014. It offers a
powerful processor and WiFi connectivity
for a fraction of the cost of other options,
but it is available in such a wide variety of
form factors that choosing the one for you
can be challenging. Thankfully, help is at
hand to ease the confusion, as a variety
of manufacturers have integrated it for
more friendly development boards with all

associated components. Adafruit’s Huzzah
and SparkFun’s ESP8266 Thing are both
very similar modules for example, designed
to bring the ESP’s connections out to a
familiar dual in-line footprint.
On the development front, the ESP is
an extremely versatile device, having
a variety of language, development
environment, and firmware choices for the
would-be coder. As well as C++ through an
Arduino IDE add-on and firmware, there is
MicroPython, as well as other firmwares
supporting BASIC and JavaScript.
However, many people choose the Arduino
IDE route for this platform due to its
familiarity and community support.

Below
The ESP-01, a
popular module
featuring the
ESP8266 processor

NOT JUST A TOY:
THE BBC MICRO:BIT

THE ARDUINO IDE IS NOW SUPPORTED BY A


VAST NUMBER OF BOARDS, INCLUDING


MANY THAT AREN’T MADE BY ARDUINO...


IT IS OFTEN A SENSIBLE CHOICE TO USE IT

Free download pdf