Configure the EFM8 to program from the usb-to-ttl
After Install Simplicity Studio then we need to need to add a product so that we dont need to create new project and select the IC every time
As shown in the image above, after create a new product, we can choose the product name with the target chip which you use (this lab is used EFM8BB52F16G-C-QFN32)
Then we can select on the the product name as shown in the image below and choose create new project
Then we can choose si8051 Configurator Project as shown below
Then give a project name
Then right click on the project and choose properties then you will see the properties setting, and click on the retarget serial as shown in the image below
Custom EFM8 by click on the custom_efm8.. as shown below
First we need to enable the crossbar by select on the PORT I/O and enable crossbar
After that click on the UART0
Then Click on the pin P0.4 and select it Digital Push-Pull Output
and P0.5 with Digital OpenDrain I/O
The defaultMode peripheral is next to defaultmode PORT I/O
First click on the clock control and change the clock source divider to SYSCLK_PREDIV/1
Then click on UART0 and WatchDog Timer and disable the watchdog timer as shown below
Go to timer and choose Timer 1 mode to Mode 2: 8 bit counter/Timer and change clock source to use SYSCLK
And change the Target Overflow Frequency to 230400 (115200 * 2) buadrate
Then you will see the baudrate in the UART0 is 115566 with is around 115200
Goes to efm8load which is in the dist of the efm8load main and copy the path
Then go to advance setting in your computer
and in the system properties choose Environment Variables
Then create new path and paste the path that you copied from the dist of efm8load
First we include the retargetserial.h
#include "retargetserial.h"
Then in the main function, let SCON0_TI = 1 and print Hello 8051
SCON0_TI = 1;
RETARGET_PRINTF("Hello 8051\n");
Then right click on the project and click build
Right click on the project and click Show In -> System Explorer and then find the .hex file of your project.
In that path, right click and choose open in terminal then
- List the port with
efm8load -l
- Identified the CHIP with
efm8load -p COM11 -i
- Flash the chip with
efm8load -p COM11 -w .\hello_8051.hex