1 Purpose

The Sinhmicro SINH51 platform is an 8-bit MCU platform compatible with the MCS51 instruction set, including SS80X, SS880X, SS881X, SS882X, SS883X, SS885X, SS886X, and other MCU families.

PlatformIO is an open source IoT development ecosystem that provides a cross-platform code builder and integrated development environment (IDE). Together with one of the most popular code editors---- Visual Studio Code (VS Code), you can set up an easy-to-use and extremely convenient SINH51 development environment.

For specific construction methods and steps, please refer to the instructions in the subsequent sections of this article.

2 Installation and configuration of PlatformIO IDE

The installation of PlatformIO IDE can refer to the following official link:

https://docs.platformio.org/en/latest/integration/ide/vscode.html#installation

2.1 Download and install VSCode

Download and install VSCode for your operating system from the following link (the following introduction uses VSCodeUserSetup-x64-1.55.2.exe as an example):

https://code.visualstudio.com/docs/?dv=win

2.2  Install the "platformio ide" plugin in VSCode

1)Open VSCode's extension management interface, search for and install the "platformio ide" plugin: ​​​​​​

 

2)The installation process is slow, confirm the installation through the status bar, and restart VSCode according to the prompts.

 

3)If you see a small ant icon on the left, it means that the installation has been successful.

 

3 Import of SINH51 Platform

PlatformIO IDE abstracts platform and board-level resources based on Platform and Board. This chapter explains how to import the SINH51 platform.

3.1 Download SINH51 Platform

The SINH51 Platform is located in github as follows:

https://github.com/ssmcu/platform-sinhmicro_sinh51

You can use the git tool or download the platform's resource package directly from the website:  ​​​​​ 

 

After the download is successful, name the folder platform-sinhmicro_sinh51 (as shown in the following figure):

3.2 Import the SINH51 Platform into PlatformIO

Find and enter the ".platform" directory of PlatformIO, taking win10 as an example, it is generally located in the user directory, as shown below:

​​​​​​

 

Create a "platforms" subdirectory in the directory (if it does not exist) and copy "platform-sinhmicro_sinh51" to that directory, as follows:

Finally, restart VSCode, open the PlatformIO IDE, find the Platform tab, and you can see that the SINH51 Platform has been successfully imported:

 

Click the "Sinh Micro SINH51" tab on the right to see the details of the platform, including Boards, Example, Changelog, etc., as shown in the following figure:

 

3.3 Code compilation and firmware generation

After the platform is imported, you can directly use the example included in the platform to import and compile, for example:

1)Import led-blink example:

 

2)After the import is successful, you can see the project file in the Asset Explorer interface:

Note: If it is the first time to import, the SDCC and other toolchains will be downloaded, so it will be slow, please be patient.

 

3)Click the PlatformIO IDE icon to bring up the "PROJECT TASKS" interface, and compile the stand-alone Build:

 

4)After successful compilation, generate hex and bin files (automatically imported projects, generally located in the user à document àPlatformIOProjects directory):

 

After successful compilation, use tools such as Sinhmicro's Flash Tools, download to the target platform, and execute, the specific details will not be detailed.

3.4 Modify the example code or create a new project

1)Find bliky.c to modify the code, and after the modification is completed, repeat steps 3 and 4 of section 3.3 to generate firmware:

 

2)Create a new project, enter the project name, enter the MCU platform "SS881A" or other MCU platforms, and click Finish to complete the creation.

 

3)After completing the code writing in your own new project, repeat steps 3 and 4 of section 3.3 to generate firmware:

 

 

Original article, Please mark the attribution when reprinting. 昇生微电子, www.sinhmicro.com


Loading Conversation