This picture is modified by myself from the picture in Du Yang's book. This is the minimum system. A diode is connected to the 37th pin to control the flashing. An STC89C52RC, a PL2303USB to serial port module, a 10uF electrolytic capacitor and a 10K ohm resistor form the reset circuit, two ceramic 30pF capacitors and a 11.0592 crystal oscillator form the oscillation circuit, and a light-emitting diode and 220 ohms form the flashing light verification program. 9 components, 9 pins on the microcontroller.
Download the STC-ISP programming program, default settings, first disconnect the +5V of STC89C52RC, open the hex file to be written, press download, wait for the prompt, connect the +5V, and start programming. If successful, the light will start flashing.
After backing up the UV3.CDB of keic3, replace it with the UV3.CDB described in the STC official website. Then you can select the STC89C52RC model. The following is the C program for the flashing light:
#include
#define uchar unsigned char
#define LED P0
void delay(int);
void main()
{
LED = 0xff;
while(1)
{
LED=~LED;
delay(200);
LED=~LED;
delay(200); //This can be set longer, the pattern of the light flashing will change
}
}
void delay(int x)
{
int i,j;
for(i =0;i
}
It's quite simple. Just wrap the copper wire around the pins, just like the electromagnet experiment we did when we were kids. As for other things like digital tubes controlling motors, servos and relays, programming is easy as long as you don't burn the microcontroller.
Previous article:CD4053 control with LCD display
Next article:51 MCU + LCD 12864 with font library + DS1302 digital clock C source program
Recommended ReadingLatest update time:2024-11-16 13:57
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- An important wireless technology is about to make its debut. If you want to know more, read this!
- About Bluetooth External Antenna
- CC3200 Kit - OURS-SDK-WFB Getting Started
- Initial understanding of R329 development board - system
- Discussion: Why is the promotion and popularization of 5G not as fast as 4G and 3G?
- Flash - How to modify an application from RAM configuration to Flash configuration?
- BearPi-HM Nano 3 + Analysis of source code writing process under vscode
- STC15W104 power-off wake-up can not be done, please help
- Shift register based frequency divider
- DSP C6000 Architecture