Loading MicroPython on a Board

In the latest Python tutorial series, we look at loading MicroPython onto six different microcontroller development boards.

MicroPython is an implementation of the Python 3 language that has been optimized for microcontrollers. It is a full Python compiler and runtime environment, but it uses only a subset of the Python language (to save on code space). Many of the low-level hardware access functions are written in C to make the calls more efficient, but it is still (basically) an interpreter running on tiny hardware.

MicroPython logo

I know that many more experienced readers will likely balk at the idea of running an interpreter on a microcontroller (it's OK; I had the same reaction running the Java Virtual Machine on microcontrollers). If your primary concerns are code space, real-time deadlines, speed and power efficiency, then you are absolutely correct: assembly or C is more than likely the way to go.

That being said, MicroPython has the opportunity to compete with Arduino when it comes to fast prototyping and getting a project working (assuming your main focus is to just get something working for your boss, Maker Faire, a convention, etc.). Students who are learning Python in school now have the opportunity to easily create something in hardware, and I will happily welcome more people into the embedded world. If someone gets a taste for how much fun it is to blink a light on a microcontroller, it's only a matter of time before they want to write their own RTOS.

If you're looking to get started with MicroPython, a few boards (such as the pyboard, OpenMV M7, LoPy4 and micro:bit) come pre-loaded with the interpreter. Other boards (like the ESP32 Thing and Teensy 3.x) require some work to load the interpreter. To get you started flashing (or updating) the MicroPython interpreter on these boards, we have a tutorial for you!

How to Load MicroPython on a Microcontroller Board

September 4, 2018
This tutorial will show you how to load the MicroPython interpreter onto a variety of development boards.

If you already have one of the supported boards lying around, I recommend giving MicroPython a shot. It's definitely an interesting experience controlling hardware with Python commands in something like an interactive shell.