Jump to content
Electronics-Lab.com Community

Machine Learning with ARM Cortex M33 Microcontroller


Recommended Posts

Machine Learning and TensorFlow Lite for Microcontrollers(TFL4M)
While TensorFlow Lite (TFL) for Microcontrollers is designed to run machine learning models on microcontrollers and other devices with only a few kilobytes of memory. The core runtime just fits in 16 KB on an Arm Cortex M3 and can run many basic models. It doesn't require operating system support, nor any standard C or C++ libraries, not even dynamic memory allocation.

Ameba and TFL4M
Ameba is an easy-to-program hardware platform for developing all kinds of IoT applications. AmebaD is equipped with various peripheral interfaces, including WiFi, GPIO INT, I2C, UART, SPI, PWM, ADC. Through these interfaces, AmebaD can connect with electronic components such as LED, switches, manometer, hygrometer, PM2.5 dust sensors, …etc. 

What's best? Ameba can be programmed using Arduino IDE, MicroPython and standard C SDK which are all open-source!


TFL for Microcontrollers--Hello World

Hello World is by far the easiest ML model that can be demo, you only need a LED,or not at all. Here is how we run TFL4M with Hello World,


• Ameba D [RTL8722 CSM/DM] x 1
• LED x 1


Download the Ameba customized version of TensorFlow Lite for Microcontrollers library at https://github.com/ambiot/ambd_arduino/tree/master/Arduino_zip_libraries.
Follow the instructions at https://www.arduino.cc/en/guide/libraries to install it.
Ensure that the patch files found at https://github.com/ambiot/ambd_arduino/tree/master/Ameba_misc/ are also installed.

Open the example, “Files” -> “Examples” -> “TensorFlowLite_Ameba” -> “hello_world”.


Upload the code and press the reset button on Ameba once the upload is finished.
Connect the LED to digital pin 10 and ground, ensuring that the polarity is correct. You should see the LED fade in and out rapidly.
In the Arduino serial plotter, you can see the output value of the Tensorflow model plotted as a graph, it should resemble a sine wave.



Need more resources to get started with Ameba?

Check out the

1. Ameba Official website at https://bit.ly/AmebaOfficialWebsite

2. Ameba Forum at https://bit.ly/AmebaForum

3. Ameba Facebook at https://bit.ly/AmebaFB



Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...