Getting Started

Board Introduction

AMBG2 board is shown in following figure.

../../../_images/rtl8721f_board.jpg

AMBG2 board

Please refer to the following figure and table for the pin diagram and functions.

../../../_images/rtl8721f_pin.svg

AMBG2 pins

AMBG2 pin map and functions

Arduino Pin

GPIO Pin

GPIO INT

ADC

PWM

UART

SPI

I2C

D0

PA_2

D1

PB_20

D2

PA_26

D3

PA_25

D4

PA_24

D5

PA_23

D6

PA_22

D7

PA_21

D8

PA_18

D9

PA_19

D10

PA_28

D11

PA_15

D12

PA_16

D13

PA_20

D14

PA_14

D15

PA_17

D16

PA_5

D17

PB_26

D18

PA_4

D19

PB_25

D20

PA_27

D21

PB_24

D22

PB_23

D23

PB_22

D24

PB_14

D25

PB_17

D26

PB_21

D27

PA_3

D28

PB_19

D29

PB_15

D30

PB_16

D31

PB_18

D32

PB_13

Set Up Developing Environment

OS environment

AMBG2 (RTL8721F) board currently supports Windows OS 64-bits, Linux OS (Ubuntu) and macOS. To have the best experiences, please use the latest version of OS.

Installing the driver

First, connect AMBG2 to the computer via USB Type-C to Type-A cable.

../../../_images/rtl8721f_usb_typec.jpg

Connect AMBG2 board to computer

If this is the first time connects AMBG2 to computer, the USB driver for AMBG2 will be automatically installed.

If you have driver issue of connect board to computer please go to https://www.prolific.com.tw/ for USB driver.

Check the COM port number in Device Manager of computer.

../../../_images/com_port.png

Check COM port number

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 can run on AMBG2 too.

Arduino IDE can be downloaded in the Arduino website: https://www.arduino.cc/en/software

When the installation is finished, open Arduino IDE.

To set up AMBG2 correctly in Arduino IDE, go to File > Preferences…

../../../_images/file_preferences.png

And paste the following URL into Additional boards manager URLs field:

https://github.com/Kyderio/arduino_test/raw/master/Arduino_package/package_realtek_test_index.json
../../../_images/additional_boards_manager_urls.png

Add Additional boards manager URLs

Next, go to Tools > Board > Boards Manager…

../../../_images/tools_boards_manager.png

Go to boards manager

Enter realtek in the search box, find Realtek Test Boards (32-bit ARM Cortex-M33 @200MHz) from the filtered list, select the desired version from the dropdown menu, and click INSTALL, then the Arduino IDE starts to download required files.

../../../_images/boards_manager_install.png

Install board in BOARD MANAGER

After installing, we select board via

Tools > Board > Realtek Test Boards(32-bits ARM Cortex-M33 @200MHz) > AMBGreen2 (RTL8721FCM)

../../../_images/select_board.png

Select board

Setup port

Click Tools > Port, select the corresponding port from the dropdown menu.

../../../_images/select_port.png

Select port

Try the First Example

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

../../../_images/file_examples_basics_blink.png

Select blink example

Arduino IDE opens a new window with the complete sample code.

../../../_images/blink_sketch.png

Blink example

Next, we compile the sample code directly, click Sketch > Verify/Compile

../../../_images/blink_sketch_verify_compile.png

Click 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.

../../../_images/compiling_done.png

Compiling done

Upload

Afterwards, we will upload the compiled code to board.

Please make sure board is connected to computer, then click Sketch > Upload

../../../_images/blink_sketch_upload.png

Click 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 DOWNLOAD button, then press and release the CHIP_EN button, lastly release the DOWNLOAD button.

Again, during the uploading procedure the IDE prints messages. When upload completed, the Done uploading message is printed

../../../_images/uploading_done.png

Uploading done