#include <STC89C5xRC.H>
int main()
{
char buf;
TMOD = 0x21; //Set the working mode of timer1
SCON = 0x50; //Set serial communication format
TH1 = 0xE6; //Set the initial value of timer1
TL1 = 0xE6;
TR1 = 1; //Start timer1
while(1)
{
if(RI == 1)
{
//If data is received
buf = SBUF;
RI = 0;
SBUF = buf; //Send the received data back
while(TI == 0); //Wait for data to be sent
IF = 0;
}
}
return 0;
}
Previous article:51 single chip microcomputer - LED water light
Next article:8051 and ESP32 CAM serial communication
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Lotus launches ultra-900V hybrid technology "Luyao" to accelerate the "Win26" plan
- The new engine of the automotive industry: AI-driven predictive maintenance
- Himax Technologies releases third-generation LCD TDDI and high-end OLED touch IC and announces mass production to promote innovation in automotive display technology
- ON Semiconductor and Subaru Collaborate to Integrate Hyperlux Sensors into Subaru's Next-Generation EyeSight System
- Professor Tang Weiping of Shanghai Jiao Tong University: Research progress of two solid electrolyte materials
- Intelligent driving + intelligent cabin, how can domestically produced “smart cars” become more popular?
- What exactly is SLAM, which is often mentioned in autonomous driving?
- Shenzhen Institute of Advanced Technology and BYD will cooperate in the development of solid-state batteries
- What systems are you using?
- Do you know 5G NR?
- RF technology and integration strategy of mobile phone RF components
- What circuit can achieve this function?
- Embedded Development - sqlite3 cross compilation
- "Play Board" + Shared Bicycle Control Board-Hardware Modification 2
- Playing with Zynq Serial 12 - Using GIT for project backup and version management 4
- Several considerations in hardware circuit design
- This simple problem with the 51 single-chip microcomputer is a bit puzzling. Can you help me figure out where the problem lies?
- How does a power limiter limit power?