Maker Pro
Custom

Electronics Prototyping Platforms - micro:bit, MicroPython, and PIC/AVR

August 28, 2018 by Robin Mitchell
Share
banner

Get familiar with different platforms and microcontrollers to help you decide which one to use in your next project.

The Arduino and Raspberry Pi are really useful platforms for creating DIY projects, but they are not the only ones out there. As there are so many different platforms we will focus on some of the most popular in this chapter. These platforms include

  • micro:bit
  • MicroPython
  • PIC / AVR

An Overview of micro:bit

The micro:bit is a small single board microcontroller system that is aimed at the educational market. Although its creators originally designed the micro:bit to be used by beginners and students for elementary projects, it is packed full of peripherals and plenty of GPIO, making it ideal for a lot of projects. Some of the onboard peripherals and sensors include:

  • Accelerometer
  • Magnetic field sensor
  • 5 x 5 LED array
  • Light detector (via LED array)
  • Bluetooth
  • Temperature sensor
  • 3 large GPIO clip points
  • Two buttons
  • USB connectivity

But the wonders of the micro:bit do not stop at the board itself — it has a brilliant programming environment that is helpful for both beginners and advanced users wanting to get quick prototypes made. The official programming IDE for the micro:bit is called MakeCode and while programs can be coded in JavaScript they can also be programmed using blocks. The best way to understand how blocks work is to see a block program. 

Programming Neo

Instead of writing code, blocks are dragged into a workspace that can be joined together in a very similar fashion to jigsaw pieces. This prevents a lot of coding mistakes as well as providing a visual method for coding (i.e., programs are easier to read and understand their function). 

The use of blocks also has another advantage: peripherals are easier to use. Setting up radio communication via Bluetooth can be a complex task but with just the use of a few blocks, a radio program that transmits and receives numbers can easily be created. 

A radio program made in minutes.

An Overview of MicroPython

Python is a fantastic language for creating cross-platform code quickly all the while making libraries easy to use. One clever engineer, Damien P. George, saw the many advantages of Python and decided to port Python to microcontrollers and created MicroPython as a result. 

The PyBoard is a specialized board designed to run MicroPython and provides some useful peripherals including I2C, SPI, and an inbuilt accelerometer but MicroPython can be made to run on other ARM processors. 

One device, in particular, that really takes advantage of MicroPython is the ESP8266 which has a special port of MicroPython which includes Wi-Fi and internet functionality. This means that you can very quickly create IoT projects using Python scripts and easily download them to microcontrollers all without needing a specialized programmer. 

The ESP8266 especially takes advantage of MicroPython!

An Overview of PICs and AVRs

For those who want to design their own highly customized projects, personalized circuit boards, or even create products may find PICs or AVRs more appropriate. 

Unlike the Arduino and Raspberry Pi boards, PICs and AVRs require a dedicated programmer which is typically a USB device with 6 to 10 output pins that connect to the microcontroller.

The MPLAB Xpress Evaluation Board with a PIC (left) and the STK600 starter kit with an AVR (right). Images courtesy of Microchip.

While creating PIC and AVR circuits requires some experience, the resulting circuits are almost always cheaper than those built using prototyping tools like the Arduino. Since PIC- and AVR-based projects are often designed from scratch the designer is more likely to understand every aspect of the circuit (this is useful when trying to fix problems and debug software).

PIC and AVR microcontrollers are only two main types of many available on the market but which one is the best? Which one should you pick? As it turns out, no microcontroller is the best on the market for every single project, as they all have different properties that make them useful in certain applications. For example, PIC devices are generally slower than AVR devices but have a better range of onboard peripherals. PIC devices are often cheaper than AVR and are arguably better supported through the different XC compilers available but AVR programs can be compiled with WinAVR which supports limited object orientated programming. 

There are development platforms available for both options. AVR microcontrollers can be programmed using AVR Studio, while PIC microcontrollers use MPLAB.

Options for Every Project

Every microcontroller and platform has its own perks and pitfalls depending on what you want to create. It's a challenging and exciting process to find the best platform for your project! The best way to get comfortable is to dive in and see what you create.

Cover image courtesy of Seth Morabito (CC BY-SA 2.0).

Author

Avatar
Robin Mitchell

Graduated from the University Of Warwick in Electronics with a BEng 2:1 and currently runs MitchElectronics.

Related Content

Comments


You May Also Like