Loading MicroPython on a Board

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

Favorited Favorite 3

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.


Comments 4 comments

  • Member #600224 / about 5 years ago * / 1

    What would be the procedure to get MicroPython on the Sparkfun SAMD21 Mini Breakout boards? Can that be included in this document? I would like to have these boards working with MicroPython in the same way it works on the pyboard, ie... seeing a drive in windows, be able to use the repl interface and program it by simply updating python files .....

    • santaimpersonator / about 5 years ago / 1

      Currently, only a derivative of MicroPython, called CircuitPython, works with the SAMD21. Unfortunately, unless you have the RedBoard Turbo, you will need to flash the UF2 bootloader to your dev board. From there, you should be able to drag and drop the CircuitPython firmware as described in the hookup guide for the RedBoard Turbo.

      • Member #600224 / about 5 years ago / 1

        Would it be possible to purchase the SparkFun SAMD21 Mini Breakout with such UF2 bootloader on it? So we, the users, can start at your step 2 ... dropping circuitpython on it? Or, which guide do you recommend to follow to get the SparkFun SAMD21 Mini Breakout flashed with an uptodate and working UF2 bootloader?

Related Posts

Pete's Super Headphones

Recent Posts

Open-Source HVAC?

What is L-Band?

Tags


All Tags