Initial STC89C52RC microcontroller experiment

Publisher:数字行者Latest update time:2016-09-30 Source: eefocusKeywords:STC89C52RC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The previous AT89S52 experimental board needed parallel port programming, while the STC could be programmed via serial port. I read the book "Fall in Love with Microcontrollers", which introduced a homemade USB programming cable and used a USB to UART interface module (implemented by CP2102 chip) - the module has 5V and 3.3V power outputs for the microcontroller. Then I went to find a USB-serial port module implemented by PL2303 for sale. It was also very convenient to connect, a minimum system,
Initial STC89C52RC microcontroller experiment - Once upon a time - Once upon a time

 

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   for(j = 1;j<=600;j++);
}

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.

Keywords:STC89C52RC Reference address:Initial STC89C52RC microcontroller experiment

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

51 single chip microcomputer (STC89C52RC) small comprehensive experiment (continued 2)
  After the last experiment, the circuit was tested in practice and found that there were still problems. The main reason was that the voltage drop time became very slow. After careful inspection of the circuit, it was found that the main reason was that the capacitance of the capacitor was changed. The original filte
[Microcontroller]
Design of digital clock based on stc89c52rc microcontroller (digital tube display)
Things always look simple, but they are not so easy to do. I wrote this program according to the tutorial at the beginning. I skipped some parts that I didn't understand... It turned out that this was not advisable... After writing a hundred lines, I compiled it and got an error! I couldn't solve it. O
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号