1. Project Introduction
STC89C52RC is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of Flash program memory, 512 bytes of RAM data memory, and instruction code fully compatible with traditional 8051 microcontrollers. It is cheap, high-speed and reliable, low-power, and highly anti-interference. Therefore, a minimum system board with STC89C52RC-DIP-40P plug-in type package is designed. All components on the entire board are in plug-in type package, which is easy to weld and help everyone get started quickly.
2. Learning Outline
51 MCU Video Tutorial
Course Content
Course Details
Video Learning
Lecture 1: Project Explanation
Overall Introduction 51 MCU
Click to Learn
Lecture 2: Client Download
Download and Activate Jialichuang EDA Professional Edition Client
Click to Learn
Lecture 3: Find Components
Introduction to Three Component Search Methods of Jialichuang EDA Professional Edition
Click to Learn
Lecture 4: Design Schematic
51 MCU Schematic Design
Click to Learn
Lecture 5: Design PCB
51 MCU PCB Design
Click to Learn
Lecture 6: PCB Order
Production File Export and Order
Click to Learn
3. Onboard Resources

Figure 2-1 STC89C52RC-DIP-40P Minimum System Board Resource Diagram Main
Control Chip: STC89C52RC-DIP-40P;
Power Interface: TYPE C, 2Pin Plug-in;
LED: 1 power indicator, 2 status display lights;
Buttons: 1 system reset button, 2 function buttons;
Debug interface: USB to TTL serial port burning mode, 4Pin straight plug pin;
External pins: lead out four groups of programmable IO ports (P0, P1, P2, P3 ports), four-way power expansion;
IV. Advantages and characteristics

Figure 3-1 STC89C52RC-DIP-40P minimum system board size diagram
The board is compact in appearance, with a size of only 90mm*50mm (3535mil*1968.5mil);
The entire board uses straight plug-in packaging, which is convenient for welding and quick to get started;
cheap, ultra-low power consumption, rich functional pins, and high cost performance;
Use Jiali Chuang high-quality PCB and genuine components to ensure product quality;
V. Circuit analysis

Figure 4-1 STC89C52RC minimum system board schematic diagram
1. Power supply circuit
The power supply circuit is mainly composed of TYPE-C interface, slide switch, filter capacitor, power indicator light, and uses a 2Pin TYPE-C interface, which is simple and convenient, easy to weld, and controls the power supply of the entire board by opening and closing the slide switch. C1 and C2 are power filter capacitors, R1 is the current limiting resistor of the power indicator light, and LED1 is the power indicator light. When the switch is closed, it will light up for prompting.

Figure 4-2 Power input part
2. Main control circuit The main control
microcontroller uses STC89C52RC (DIP-40 package), with an operating voltage of 3.3~5.5V and an operating frequency range of 0~40MHz, equivalent to 0~80MHz of ordinary 8051, and the actual operating frequency can reach 48MHz. The Flash program memory space size is 8K bytes, which can be erased and written more than 100,000 times. The chip integrates 512 bytes of RAM data memory, and the operating temperature range is -40~85℃.

Figure 4-3 Comparison of main control chips
STC89C51RC/RD+ series has HD and 90C versions, which can be distinguished by the last few letters in the bottom line of text on the surface of the microcontroller.
The HD version does not have P4.4/P4.5/P4.6 ports, the RESET pin has a 45~100K pull-down resistor inside, and the EA# pin is pulled up to VCC inside.
The 90C version does not have EA and PSEN pins, but has P4.4/P4.5/P4.6 ports. The ALE/P4.5 pin is used as the ALE pin by default. When used as the P4.5 port, it needs to be set in the STC-ISP programmer when burning the user program.

Figure 4-4 Pin function arrangement of the minimum system board of STC89C52RC
Figure 1-1 Definition of the pins of the core board of STC89C52RC Explanation of multiplexing
Pin
description
P0.0~P0.7, P1.0~P1.7
P2.0~P2.7, P3.0~P3.7
Standard I/O port
RXD
Serial port 1 data receiving end
TXD
Serial port 1 data transmitting end
T0/T1/T2
External input of timer/counter
T2EX
Timer/counter 2 capture/reload mode trigger control
INT#
External interrupt, falling edge interrupt or low level interrupt
WR#
External data memory write pulse
RD#
External data memory read pulse
All four groups of common pins of the STC89C52RC chip are brought out to facilitate the development of expansion projects. The P0 port can be used as an I/O port or as an address/data multiplexing bus. The P0 port is an open-drain output. When used as a bus extension, no pull-up resistor is required. When used as an I/O port, a 4.7K~10K pull-up resistor must be connected externally. Here, the P0 port uses a 10K pull-up resistor -- RN1.

Figure 4-5 STC89C52RC master control circuit
3. Crystal oscillator circuit
The function of the crystal oscillator is to provide a clock signal to the minimum system. The function of the capacitor next to the crystal oscillator is to ensure that the output oscillation frequency is more stable.

Figure 4-6 Crystal oscillator circuit
4. Reset circuit
Reset is also called restart. Press the SW2 button and the master control RST pin is pulled high; release the SW2 button and the RST pin is pulled low, generating an external reset pulse to reset the system.

Figure 4-7 Reset circuit
5. The peripheral circuit
test status display light is used to test the P2.0 and P2.1 pins of the single-chip microcomputer, and the test light is turned on and off through the program.
Figure 4-8 The LED display circuit
reserves two user function buttons, which can customize the button functions and are connected to the P3.2 and P3.3 pins of the single-chip microcomputer.

Figure 4-9 The key input circuit
adopts the USB to TTL serial port burning method, and reserves a 1x4Pin straight plug-in pin header interface, RXD--P3.0, TXD--P3.1, for debugging and downloading programs.

Figure 4-10 The download debugging interface
is convenient for expanding projects and verifying various functions. Four 1x8Pin 2.54mm pin headers are used to lead out the four groups of I/O pins of the single-chip microcomputer, and four power outputs are also led out at the same time, which is convenient for the use of peripheral circuits.

Figure 4-11 Extension interface part
6. Notes
When drawing the schematic diagram, pay attention to the following:
Draw according to the module circuit division and indicate the circuit function;
fill in the project name and other information on the drawing attributes;
When purchasing materials, pay attention to the following:
First select the materials in stock, then select the price sorting to purchase;
Try to purchase materials from the same warehouse and choose a warehouse close to each other to shorten the delivery time;
When purchasing multiple orders, you can save shipping costs by binding orders;
In PCB Layout, pay attention to the following:
The crystal oscillator should be as close to the chip as possible, and no wiring should be done at the bottom to prevent signal crosstalk;
Straight lines should be preferred for wiring, and obtuse angles or arcs should be used where turns are required;
Add silk screen logos and annotate the interface functions;
JLCJLCJLCJLC specifies that the custom silk screen can be hidden under the device, and the finished board is beautiful;

Figure 6-1-1 PCB routing reference diagramAttention
should be paid during welding:
When welding, you can click the welding auxiliary tool in the toolbar of Jiali Chuang EDA, and the real-time interaction facilitates welding;
When welding the top layer, it is recommended to weld the main control chip first to avoid other devices affecting the welding;When
welding the pin header, you can use an empty board or a perforated board to support it to prevent the welding from being slanted and affecting the use;
The welding sequence should follow the principle of from low to high to avoid affecting the welding of small devices;

Figure 6-2-1 PCB empty board-top layerAttention
should be paid during debugging:
Before power-on debugging, check whether there are problems such as cold soldering and short circuit in the welding. Only after the inspection is correct can the power-on test be carried out;
Use STC-ISP to download the programming and burning software, the official download address is: http://www.stcmcudata.com/Use
the USB to TTL serial port burning tool to download the program to the microcontroller, and the RXD end of the USB to TTL line is connected to the TXD end of the microcontroller, and the TXD end is connected to the RXD end of the microcontroller;
After clicking Download/Programming, you need to re-plug VCC to power on, and it will show that the handshake operation is successful, that is, the user code is successfully downloaded.