MicroPython实现了Python 3编程nguage for microcontrollers and microcomputers. It is a firmware solution designed to implement high-level language features of Python into low-level hardware platforms. The firmware is optimized to run in constrained environments while allowing a small subset of Python 3 standard libraries into embedded programming.
micropopthon.firmware can run in a footprint of 256 Kilobytes and 16 Kilobytes of RAM. MicroPython can offer several high-level programming features like arbitrary precision integers, object-oriented programming, generators, closures, exception handling, and list comprehension, even with such limited code space and memory. Usually, such features are not available in typical microcontroller programming. All these features are available with access to low-level hardware via the machine module of the MicroPython firmware.
Plus, MicroPython compiler and runtime code includes an interactive prompt called REPL (Read-Eval-Print-Loop) that allows executing commands from a desktop computer directly on an embedded platform. The commands using REPL are executed via UART, where the target microcontroller board is connected to the host PC over USB. This is useful in quick and real-time testing and debugging of embedded systems.
MicroPopython中允许的显着高级语言功能之一是多线程。通常,裸金属是多线程能力的空隙。MicroPopthon固件的多线程特征允许通过从单个微控制器处理许多嵌入式任务并允许您思考典型的编程循环来加速嵌入式应用程序。
micropopthon.is open source
micropopthon.is available for general use under MIT License. Many of its modules and libraries are also available under MIT license or similar open source license. MicroPython is free to use for both educational and commercial purposes. Anybody can use and modify the firmware. It is an open-source project with source code available onGithub。作为一个开源项目,MicroPopyThon为社区贡献开放。如果您正在寻找针对特定硬件平台,微控制器,端口或功能的固件版本,请查看官方micropopthon.downloadlink.
micropopthon.vs. Python
micropopthon.is largely an implementation of Python 3.4 with some select Python 3.5 and above features. Many standard CPython libraries have been rewritten in C99 to run within constraint environments of bare metals (microcontrollers and microcomputers without any operating system) as part of MicroPython. These micro-fied standard Python libraries form the core of MicroPython firmware. Not all standard Python libraries have been rewritten to form MicroPython; MicroPython is a subset of standard Python. It includes the re-implementation of only those Python libraries that may be useful in programming embedded systems or programmatically enhancing embedded applications.
micropopthon.may differ in syntax and behavior with equivalent operators, functions, and modules of standard Python at many places. A lot of these conflicts are listed at the以下链接。Except for a few conflicts listed in the link mentioned above, most of the MicroPython syntax and programming is compliant withstandard Python documentation。
A microcontroller board, RTOS, or operating system supported by MicroPython is called a MicroPython Port. It is important to know that many features of core MicroPython may be unavailable for a particular port, i.e., it may not be supported in a given microcontroller, RTOS, or operating system. Plus, a particular port may have additional modules and functionalities of MicroPython. For example, the MicroPython version for ESP32 and ESP8266 has additional libraries and functions available to handle network connections and supports WebREPL (REPL over web sockets).
支持的电路板和MicropeThon港口
MicroPopthon适用于几个公共平台,包括X86,X86-64,ARM-Thumb和XTensa。它非常快,代码执行,速度可达高达168 MHz。Micropopthon支持的官方微控制器板是Pyboard。PyBoard具有以下突出功能。
-> STM32F405RG microcontroller
-> 168 MHz Cortex M4 CPU with hardware floating point
-> 1024KiB flash ROM
-> 192KiB RAM
- >微型SD卡插槽
-> Micro-USB port
-> On-board 3-axis accelerometer and RTC
-> 29 GPIO; 3x 12-bit ADC available on 16 pins 4 with analog ground shielding and 2x 12-bit DAC available on pins X5and X6.
Not just the pyboard, MicroPython can be used on many other microcontroller boards of STMicroelectronics. Some of the microcontrollers of STMicroelectronics having full-support of MicroPython firmware are listed below.
- > espruino pico(stm32f401cd)
- >黑色STM32F407VET6(STM32F407VE)
-> BLACK STM32F407ZET6 (STM32F407ZE)
- >黑色STM32F407ZGT6(STM32F407ZG)
- > FEZ CERB40 II(STM32F405RG)
-> G30HDR Module (STM32F401RE)
-> FEZ Lemur (STM32F401RE)
- > Netduino Plus 2(STM32F405RG)
-> OpenMV (STM32F765)
- > HY-STM32F4xxcore144核心/开发板(STM32F407ZGT6)
- >水资源草株(STM32F405RG)
-> Olimex STM32-405STK (STM32F405RG)
-> Olimex STM32-E407 (STM32F407ZG)
- >核心F401RE(STM32F401RE)
- > STM Discovery STM32F401(STM32F401VC)
-> STM Discovery STM32F407 (STM32F407VG)
- > STM Discovery STM32F429(STM32F429ZI)
- > STM Discovery STM32F746G(STM32F746NG)
- > STM32F407VET6迷你(STM32F407VE)
Apart from the above-listed microcontrollers of STMicroelectronics, MicroPython supports the following notable embedded platforms.
-> ESP32
-> ESP8266
-> Micro:Bit
- > Wipy和CC3200
-> Pyboard D-Series
- >青少年3.x
-> Adafruit Circuit Playground Express
- > Arduino到期
- >柏树苍裂
-> Raspberry Pi Pico
西风是一个实时操作系统upported by MicroPython. MicroPython can run as a thread in other RTOS like pyRTOS and FreeRTOS.
micropopthon.libraries
The core MicroPython includes implementation of several standard Python 3.4 libraries, which consists of an array, binascii, builtins, cmath, collections, errno, gc, hashlib, heapq, io, json, math, os, random, re, select, socket, ssl, struct, sys, time, uasyncio, zlib, and _thread. Other libraries included in MicroPython are hardware-specific. These are called micro-libraries, including Bluetooth, btree, cryptolib, framebuf, machine, micropython, neopixel, network, and uctypes.
Port-specific libraries
不同的微控制器和RTOS提供额外的功能和核心微控制器操作。MicroPopthon包括特定于特定微控制器板和实时操作系统的库,以利用其独家功能。例如,Pyboard的PicroPopython的Port Picsopython的特定于PIClopython包括PyB,STM和LCD160Cr等库。WIPY的MicroPopython的Port Poor特定版本包括Wipy库和Adcchannel,TimerChannel,Timerwipy和Adcwipy等附加类。ESP8266和ESP32板的MicroPopyThon的特定于港口特定版本包括ESP和ESP32包。RP2包另外包含在Raspberry PI Pico的MicropeThon版本中。额外的模块Zephyr,包装在Zephyr Rtos的Micropopthon版本中。
Additional Python libraries from micropython-lib
核心Micropopthon模块在MicroPopthon术语中称为Umodules。除了重写以形成核心微量的选择标准Python库之外,还有许多其他标准Python库在MicropeThon项目中被重写。可以以单独的分布方式访问这些库以micropython-lib。Most of these libraries/modules use FFI for OS-specific functionalities. That is why micropython-lib can be generally used only on hosts with POSIX-compatible operating systems like Linux, FreeBSD, Solaris, MacOS, etc. It has limited support for Windows. Unlike standard MicroPython modules, micropython-lib modules need to be installed either using upip or copying unzipped packages manually.
Extending MicroPython libraries
还可以扩展内置微量树库库的实现。任何用户定义的模块名为module.py覆盖包中的标准微量量调度Umodule。通过直接导入U形模块,包仍然可以使用内置功能。Micropopthon-Lib中的大多数图书馆都以相同的方式编写。
Conclusion
micropopthon.can be the next revolution in the microcontroller world after the Arduino. First of all, MicroPython has accomplished the major task of introducing Python to microcontrollers and MCU-based embedded systems. Python is the one-stop for developing networked and AI-backed applications. The use of multithreading in embedded applications will be another important milestone set by the MicroPython initiative.
你可能也会喜欢:
Filed Under:特色那188app彩票 那188abc金博宝
Questions related to this article?
问和讨论EDAboard.comand电动技术在线。comforums.
Tell Us What You Think!!
你一定是logged into post a comment.