Ameba ARDUINO: Getting Started with AMB82 MINI (RTL8735B)
Ameba is an easy-to-program platform for developing all kinds of IoT applications. AMB82 MINI is equipped with various peripheral interfaces, including WiFi, BLE, GPIO INT, I2C, UART, SPI, PWM, ADC. Through these interfaces, AMB82 MINI can connect with electronic components such as LED, switches, manometer, hygrometer, PM2.5 dust sensors, …etc. Besides, AMB82 MINI has 3 key features, Audio codec, Video codec and NN (build in NPU for AIoT).
The collected data can be uploaded via WiFi and be utilized by applications on smart devices to realize IoT implementation.
AMB82 MINI is connected to the open-source world by one of the widest development environments, Arduino. For more information, HDK, SDK, API documents, Example Guides and so on, refer to the following Ameba Arduino SDK page
AMB82 MINI board
AMB82 MINI uses Micro USB to supply power, which is common in many smart devices.
Please refer to the following figure and table for the pin diagram and functions.
AMB82 MINI Pinmap
|GPIO pin||GPIO INT||ADC||PWM||UART||SPI||I2C||SWD||LED|
|23||PF9||✓||✓||LED_BUILTIN / LEB_B (blue)|
Set up developing environment
Step 1. OS environment
AMB82 MINI board currently supports Windows OS 32-bits or 64-bits, Linux OS (Ubuntu22 and above) and macOS. To have the best experiences, please use the latest version of OS.
Step 2. Installing the Driver
First, connect AMB82 MINI to the computer via Micro USB:
If this is the first time connects board to computer, the USB driver for board will be automatic installed.
If you have driver issue of connect board to computer please go to http://www.wch-ic.com/downloads/CH341SER_ZIP.html for USB driver.
Check the COM port number in Device Manager of computer:
Step 3. Set up Arduino IDE
From version 1.6.5, Arduino IDE supports third-party hardware. Therefore, we can use Arduino IDE to develop applications, and the Arduino basic examples are supported.
Arduino IDE can be downloaded in the Arduino website: https://www.arduino.cc/en/Main/Software
When the installation is finished, open Arduino IDE. To set up correctly in Arduino IDE, go to “File” -> “Preferences”.
And paste the following URL into the “Additional Boards Manager URLs” field: https://github.com/ambiot/ambpro2_arduino/raw/main/Arduino_package/package_realtek.com_amebapro2_index.json
Next, go to “Tools” -> “Board” -> “Boards Manager”:
The “Boards Manager” requires about 10~20 seconds to refresh all hardware files (if the network is in bad condition, it may take longer). Every time the new hardware is connected, we need to reopen the Board Manager. Find “Realtek Ameba Boards” in the list, click “Install”, then the Arduino IDE starts to download required files.
After the installation tool running successfully, you may open Arduino IDE and proceed to “Tools” -> “Board” -> “Boards Manager…”. Try to find “Realtek Ameba Boards” in the list, click “Install”, then the Arduino IDE starts to download required files.
Finally, we select board in “Tools” -> “Board” -> “AmebaPro2 ARM (32-bits) Boars” -> “AMB82-MINI”
Try the First Example
Step 1. Selection Ameba Modes
There are many different Modes for user to select for different settings of compile and upload. Please refer to the following picture and table.
|* Erase Flash||Erase all firmware from flash.|
|* Auto Flash Mode||Enable this mode to avoid manual process when uploading.|
|* Upload Mode||Choose upload mode between Normal Mode and Speed Mode.|
• Normal Mode. Upload all bins as one flash bin.
• Speed Mode. Only upload the specific bin to its flash address.
|A normal flash bin should include system file bins, firmware bin, Video ISP Bin and Neural Network Bin. To run the board successfully, system file bins and firmware bin are must. Speed Mode will skip system file bins and firmware bin. For all combinations of upload, please refer to the following table.It is recommended to use Normal Mode with Video ISP Bin and Neural Network Bin at least once, for the first time using the board.|
|** Video ISP Bin||Speed Mode. Only upload Video ISP Bin to its flash address.|
Normal Mode. Upload a flash bin includes Video ISP Bin.
|** Neural Network Bin||Speed Mode. Only upload Neural Network Bin to its flash address.|
Normal Mode. Upload a flash bin includes Neural Network Bin.
|*** NN Models Object Detection||Choose Default or Customize models from Yolov4Tiny, Yolov3Tiny, or Yolov7Tiny.||For more information about Customize models, please refer to section “Apply Customized AI model”|
|*** NN Models Face Detection||Choose Default or Customize MobileFaceNet models.|
|*** NN Models Face Recognition||Choose Default or Customize SCRFD models.|
|* Standard Lib Enable||Choose the standard library function for compile and upload.|
Selections (Upload Mode, Video ISP Bin, Neural Network Bin)
|Flash Bin combinations||Remarks|
|System file bins and firmware bin||Video ISP Bin||Neural Network Bin|
|Normal Mode; Yes; Yes||✓||✓||✓|
|Normal Mode; Yes; No||✓||✓||NA|
|Normal Mode; No; No||✓||NA||NA|
|Speed Mode; No; Yes||NA||NA||✓|
|Speed Mode; Yes; No||NA||✓||NA|
|Speed Mode; No; No||✓||NA||NA|
Step 2. Compile
Arduino IDE provides many built-in examples, which can be compiled, uploaded, and run directly on the boards. Here, we take the “Blink” example as the first try.
Open “File” -> “Examples” -> “01.Basics” -> “Blink”:
Arduino IDE opens a new window with the complete sample code.
Next, we compile the sample code directly; click “Sketch” -> “Verify/Compile”.
Arduino IDE prints the compiling messages in the bottom area of the IDE window. When the compilation is finished, you will get the message as following.
Afterwards, we will upload the compiled code to board.
Step 3. Upload
Please make sure board is connected to computer, then click “Sketch” -> “Upload”.
The Arduino IDE will compile first then upload. Users are required to enter the upload mode of the board. To enter upload mode, first press and hold the UART_DOWNLOAD button, then press and release the RESET button, lastly release the UART_DOWNLOAD button. There is a 5-seconds count down set as a reminder to enter the upload mode.
Additionally, if the board that used has enabled the “Auto Flash Mode”, please ignore above instruction.
It is optional for users to check if the board entered the upload mode. Open serial monitor/terminal and look for “Download Image over UART1”.
When upload completed, the “Done uploading” message is printed.
Step 4. Run the Blink example
In each example, Arduino not only provides sample code, but also detailed documentation, including wiring diagram, sample code explanation, technical details, …etc. Please refer the detailed information of the Blink example:
In short, this example makes on-board LED blinks.
Video Tutorials and Demos
Ameba Arduino SDK page: https://www.amebaiot.com/ameba-arduino-summary/ .
Facebook Group Chinese: https://www.facebook.com/groups/AmebaIoT.
Facebook Group English: https://www.facebook.com/groups/amebaioten.