Program Microcontroller with MicroPython RTL8722 port

MENG XI

Mar 18, 2020
52
Joined
Mar 18, 2020
Messages
52
Microcontrollers are known for its low power usage and limited resources thus often deemed unable to understand Python script as Python need interpretor to translate script into machine langauge and intepretor are usaully quite resource-consuming. However, MicroPython has arisen as a lean and efficiant Python 3 interpretor that can be run on ARM Cortex-M series microcontrollers.

Ameba RTL8722 is an ARM Cortex-M33 microcontroller that has dual-band WiFi and BLE 5.0, other than that it is fully capable of running MicroPython and controls WiFi using Python script. In addition, its requirement for developing platform is also quite minimal-- only needs a serial port terminal like Tera term. Here is an example of RTL8722 controlling WiFi using just a few lines of Python code on Tera Term,

from wireless import WLAN
wifi = WLAN(mode = WLAN.STA)
wifi.scan()




Right after the last line, you will be able to see the result printed on the Tera term almost immediately,

micropython-started-4.png


Hope this post give you some ideas of how easy it is to control microcontroller using MicroPython, stay tuned and happy coding!

 
Top