Click the blue text to follow, reply with “entry materials” to obtain a comprehensive tutorial from beginner to advanced on microcontrollers
Written by | Wu Ji (WeChat: wujidanpianji)
Original work | Article 18 of the series
Approximately 1244 words, reading time is about 5 minutes
The STC microcontroller is a microcontroller based on the C51 core, independently developed by Holtek Technology, and is widely used in China.
The previous official website of STC was stc.com, but it is currently inactive, and many engineers and students cannot find the official website. The latest official website for STC microcontrollers is stcmcudata.com, which opens as follows:

STC has significantly improved performance design based on traditional C51 microcontrollers, offering superior performance at a relatively low cost, making it popular among many university students and engineers.
Next, I will briefly introduce the setup of the STC microcontroller (C51 compatible) development environment
The most commonly used compilation software for microcontroller development includes Keil, IAR, etc. Holtek Technology has not developed its own microcontroller development environment; it uses Keil C51 software for development.
The STC microcontroller program development uses Keil C51. (The most common version of Keil software also has an MDK version, but MDK is not suitable for STC microcontrollers; MDK is mainly used for ARM core microcontroller development), so we need to download and install Keil C51.
1. Download the installation package for Keil C51 software
You can directly download the Keil software from the official website, as shown in the download interface:

Downloading from the official website requires account registration, which is a bit troublesome.
You can directly search for Keil C51 download on Baidu, or search for Wu Ji microcontroller programming to obtain (with the latest registration tool).
If you are a company, you also need to purchase the software and obtain authorization to use it. The downloaded installation package includes the installation files and the registration tool.

2. Software installation:
Unzip the compressed package and install directly; I will not demonstrate it here.
Note: It is best to install in the default C drive. After installation, the desktop icon is as follows:

3. Software cracking:
Right-click the icon and select “Run as administrator” to open the software.

Enter the KEIL software interface, find the File button in the toolbar, left-click, and find License Management in the drop-down menu, left-click to display the following interface. In this interface, find the CID and copy the CID number.


Double-click keil_lic.exe to run the registration tool directly. It will emit a loud sound while running the registration tool.

Paste the previously copied CID code into the registration tool’s CID field, and select C51 in the Target dropdown.

After completing the above operations, click Generate; a code will be generated, copy that code:

Paste that code here, and finally left-click Add LIC; the word SUCCESSFULLY will appear, congratulations, you have successfully installed and cracked KEIL.

4. Install the header files for the STC microcontroller:
Download the STC-ISP software from Holtek Technology’s official website:

Double-click to open the STC-ISP software

Select Keil simulation settings -> Add model and header files to Keil, as shown below.

2.2.3 Select the installation directory of Keil C51 and click OK

2.2.4 Installation complete

4. Create a new project
Double-click the Keil software icon to open the software

As shown below: Select Project -> New uVision Project…

As shown below: Select the project folder, name the project, and then click OK

Select the corresponding model of the microcontroller, as shown below, and click OK

After clicking OK, the project interface is as follows:

Create a new file, as shown below:

Save the newly created file and name it main.c, as shown below:

Load main.c into the project, as shown below:



As shown: The microcontroller project has been successfully created. You can start writing the program now.