MicroPython has been an interesting project to watch over the last few years. If you’ve not heard of it, MicroPython is an open source project to port Python to run in a real-time, microcontroller-based environment. The ports typically are for Arm Cortex-M processors but there are several ports that run other architectures from Microchip and other vendors. There are several advantages to using MicroPython over a traditional programming language like C such as:
- Easy to learn (I’ve seen elementary students write Python code)
- It is object-oriented
- Is an interpreted scripting language which removes compilation
- Supported by a robust community including many add-on libraries which minimizes re-inventing the wheel
- Includes error handling (something that C didn’t get the memo on)
- Easily extensible
One of the issues that has been a stumbling block for MicroPython to move mainstream and into the production environment is that there haven’t been any production ready development boards or modules available. Over the last couple of years, whenever I’ve implemented a MicroPython solution for one of my clients, we’ve had to customize the board and the MicroPython kernel. It’s not difficult work and the kernel adjustments are usually to speed-up start-up or initialize safety related systems but it’s still extra work which results in extra cost and extra time. But that’s about to change.
The Pyboard D-series Module
As of this week, MicroPython has announced that their pyboard D-series modules are now available. These modules are particularly interesting because they provide a MicroPython compatible microcontroller along with built-in Wi-Fi and Bluetooth that can be connected to a carrier board through a mezzanine connector as shown below in Figure 1. This overcomes the challenges that developers face with using MicroPython in a production environment that forced them spin their own MicroPython compatible boards since the pyboard D-series is a module.
Figure 1 – The pyboard D provides developers with two variations, a standard model and a high-performance model. (Image Source: MicroPython Newsletter Issue 6)
The pyboard D-series modules come in several different options. The first is their standard model which utilizes a STM32F722 microcontroller from ST Microelectronics to provide 256k RAM and 512k of internal flash. This provides quite a bit of code space for Python scripts but just in case more is needed, there is an option to use external QSPI to add up to an additional 2MB that can be added to the file system for scripts or for data logging. The standard version also includes a single precision hardware floating point unit.
The second option available is the pyboard D-series high performance module. This module is based on the STM32F767 which provides 512k of RAM and 2MB of internal flash for application scripts. It also has a double precision hardware floating point unit and the signals to break-out Ethernet, DCMI and other peripherals through adapter boards. The processor also runs at up to 216 MHz which provides plenty of computing power to the Python interpreter and handle real-time system events.
There are several features to the new pyboard D-series that I find to be extremely interesting. First, the Wi-Fi and Bluetooth capabilities are provided by a Murata 1DX (CYW4343) which has all the Bluetooth and Wi-Fi stacks operating on-chip so that the STM32 processor is free to run the Python script. This helps to ensure that any embedded system built on the module will be able to maintain real-time performance for its intended application.
Second, since the pyboard D-series is a module with mezzanine connectors, product development can be done by using a break-out carrier board that includes additional connectors for sensors, actuators and additional memory. The MicroPython team has put together several adapters and small 12 mm x 12 mm tile boards that are designed to expand the pyboard during development as can be seen in Figure 2.
Figure 2 – For prototyping, developers can use a tile sized board with a mezzanine connector to develop and test prototypes.
I have not yet had the opportunity to try out a pyboard D-series module or the expansion modules that are part of it. I’ve placed my order and am looking forward to seeing how these stack up with my previous experiences with MicroPython. The release of the new pyboard D-series module feels like a great step to propel MicroPython from an interesting project with plenty of DIY applications to a serious option for use in real-time products. While there are plenty of platforms cropping up hoping to make embedded systems more affordable and easier to develop, I think developers need to keep an eye on MicroPython and see where this new module takes it.