Micro Python is a lean and fast implementation of Python 3 optimized to run on microcontrollers. It was successfully funded via Kickstarter and is available under an open source license. The Micro Python board runs Micro Python on bare metal and gives a low-level Python operating system to control electronic projects. It is based on an STM32 microcontroller and includes features like USB, SD card, LEDs, and pins for input/output. Micro Python provides a minimal Python operating system and standard libraries tailored for resource-constrained microcontrollers.
1. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
2. Micro Python
Python for microcontrollers
About me
Works at Carriots.com
Sofware Developer Internet Of Things Platform
Core platform developer
Integration third-party hardware/systems/software
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
3. Micro Python
Python for microcontrollers
“Micro Python was successfully funded via a
Kickstarter campaign. The software is available to
the public under the MIT open source license. ”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
4. Micro Python
Python for microcontrollers
“Micro Python is a lean and fast implementation
of the Python 3 programming language that is
optimised to run on a microcontroller.”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
5. Micro Python
Python for microcontrollers
“The Micro Python board is a small electronic
circuit board that runs Micro Python on the bare
metal, and gives you a low-level Python operating
system that can be used to control all kinds of
electronic projects.”
micropython.org
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
6. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
7. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python
● Full implementation of Python 3 grammar. Cpython 3.4 (no
batteries)
● Implements lexer, parse, compiler, vm and runtime.
● Execute files or REPL.
● Python code is compiled to byte code that run in vm.
● Storing objects in efficient ways.
● Decorator can compiled to native code. 2 time faster than
byte code.
● Memory is managed using a simple and fast mark-sweep
garbage collector.
8. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python Board
● Based on the STM32F405 microcontroller.
● The microcontroller is clocked at 168MHz.
● 1MiB flash.
● 192KiB RAM.
● The board measures 33x40 mm.
● USB interface.
● Micro SD slot.
● 2 LEDs, a switch, a real-time clock, an accelerometer, and
30 general purpose I/O pins.
9. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Micro Python as a "mini Python operating system"
● Checks for a local filesystem on the flash.
● Checks for /boot.py.
● Runs /boot.py to configure USB and other low-level
parameters that can't be changed without a reset.
● The main Python script is run if it exists. Default is
/src/main.py.
● If the main script doesn't exist, or exits, REPL (read-
evaluate-print-loop) mode is entered.
10. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Python standard libraries
● cmath – mathematical functions for complex numbers
● gc – control the garbage collector
● math – mathematical functions
● os – basic “operating system” services
● select – wait for events on a set of streams
● struct – pack and unpack primitive data types
● sys – system specific functions
● time – time related functions
additional libs in https://github.com/micropython/micropython-lib
12. Micro Python
Python for microcontrollers
Samuel de Ancos Martín @sdeancos sdeancos@gmail.com http://deancos.om
Libraries specific to the pyboard
● pyb
● Network: CC3K (wifi), WIZNET5K (ethernet)