Software:MicroPython

From HandWiki
MicroPython
MicroPython new logo.svg
Original author(s)Damien P. George
Initial release3 May 2014; 9 years ago (2014-05-03)
Stable release
1.14 / 3 February 2021; 3 years ago (2021-02-03)
Written inC
PlatformARM Cortex-M, STM32, ESP8266, ESP32, 16bit PIC, Unix, Microsoft Windows, Zephyr, JavaScript, RP2040
TypePython implementation
LicenseMIT license[1]
Websitemicropython.org

MicroPython[2] is a software implementation of a programming language largely compatible with Python 3, written in C, that is optimized to run on a microcontroller.[3][4]

MicroPython is a full Python compiler and runtime that runs on the microcontroller's hardware. The user is presented with an interactive prompt (the REPL) to execute supported commands immediately. Included are a selection of core Python libraries; MicroPython includes modules which give the programmer access to low-level hardware.[2]

The source code for the project is available on GitHub under the MIT License.[5]

History

MicroPython was originally created by the Australian programmer and theoretical physicist Damien George, after a successful Kickstarter backed campaign in 2013.[6] While the original Kickstarter campaign released MicroPython with an STM32F4-powered development board "pyboard", MicroPython supports a number of ARM based architectures.[7] The ports supported in the mainline are ARM Cortex-M (many STM32 boards, TI CC3200/WiPy, Teensy boards, Nordic nRF series, SAMD21 and SAMD51), ESP8266, ESP32, 16bit PIC, Unix, Windows, Zephyr, and JavaScript.[8] Also, there are many forks for a variety of systems and hardware platforms not supported in the mainline.[9]

In 2016, a version of MicroPython for the BBC Micro Bit was created as part of the Python Software Foundation's contribution to the Micro Bit partnership with the BBC.[10]

In July 2017, MicroPython was forked to create CircuitPython, a version of MicroPython with emphasis on education and ease of use. MicroPython and CircuitPython support somewhat different sets of hardware (e.g. CircuitPython supports Atmel SAM D21 and D51 boards, but dropped support for ESP8266). As of version 4.0, CircuitPython is based on MicroPython version 1.9.4.[11]

In 2017, Microsemi made a MicroPython port for RISC-V (RV32 and RV64) architecture.[12]

In April 2019, a version of MicroPython for the Lego Mindstorms EV3 was created.[13]

In January 2021, a MicroPython port for the RP2040 (ARM Cortex-M0+, on Raspberry Pi Pico and others) was created.[14]

Bytecode

MicroPython includes a cross compiler which generates MicroPython bytecode (file extension .mpy). The Python code can be compiled into the bytecode either directly on a microcontroller or it can be precompiled elsewhere.

MicroPython firmware can be built without the compiler, leaving only the virtual machine which can run the precompiled mpy programs.

References

  1. George, Damien P. (4 May 2014). "micropython/LICENSE at master · micropython/micropython". https://github.com/micropython/micropython/blob/master/LICENSE. 
  2. 2.0 2.1 "MicroPython - Python for microcontrollers". https://micropython.org/. Retrieved 12 August 2017. 
  3. Venkataramanan, Madhumita (6 December 2013). "Micro Python: more powerful than Arduino, simpler than the Raspberry Pi". Wired. https://www.wired.co.uk/article/micro-python. Retrieved 15 December 2016. 
  4. Yegulalp, Serdar (5 July 2014). "Micro Python's tiny circuits: Python variant targets microcontrollers". InfoWorld. http://www.infoworld.com/article/2608012/python/micro-python-s-tiny-circuits--python-variant-targets-microcontrollers.html. Retrieved 15 December 2016. 
  5. "MicroPython on GitHub". https://github.com/micropython/micropython. 
  6. "Micro Python: Python for microcontrollers". Kickstarter. https://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers. Retrieved 15 December 2016. 
  7. Beningo, Jacob (11 July 2016). "Prototype to production: MicroPython under the hood". EDN Network. http://www.edn.com/electronics-blogs/embedded-basics/4442357/Prototype-to-production---MicroPython-under-the-hood. Retrieved 15 December 2016. 
  8. George, Damien P.. "micropython/ports at master · micropython/micropython". https://github.com/micropython/micropython/tree/master/ports. Retrieved 22 October 2019. 
  9. Sokolovsky, Paul. "Awesome MicroPython". https://github.com/pfalcon/awesome-micropython#forks-and-variants. Retrieved 22 October 2019. 
  10. Williams, Alun. "Hands on with the BBC Micro-Bit user interface". http://www.electronicsweekly.com/news/design/embedded-systems/video-bbc-micro-bit-user-interface-2015-07/. Retrieved 8 July 2015. 
  11. Shawcroft, Scott. "CircuitPython 4.0.1 released!". Adafruit Industries. https://blog.adafruit.com/2019/05/22/circuitpython-4-0-1-released/. Retrieved 11 Jun 2019. 
  12. "RISC-V Poster Preview — 7th RISC-V Workshop". 28 November 2017. https://content.riscv.org/wp-content/uploads/2017/12/RISC-V-Poster-Preview.pdf. Retrieved 17 December 2018. 
  13. "LEGO releases MicroPython for EV3 based on ev3dev and Pybricks". https://www.ev3dev.org/news/2019/04/13/ev3-micropython/. 
  14. "Meet Raspberry Silicon: Raspberry Pi Pico now on sale at $4". https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/. 

External links