Today I will tell you about the serial communication of this board.
Here we don't need to look at the board, as long as we know how to use the serial port of the 51 chip. Let's go directly to the code.
#include "reg52.h"
str AUXR=0x8e; 51 special registers are not detailed
void init_uart()
{
SCON=0x50; Allow serial port interrupt mode 1, i.e. 8-bit asynchronous communication
AUXR=0x40; 1T
TMOD|=0x20; Timer mode 3 auto-reload
TH1=256-(11059200/9600/32); baud rate 9600
ES=1; Enable serial port interrupt
TR1=1; Timer 1
EA=1; Total interrupt
}
void main()
{
unsigned char buf;
init_uart();
if(RI) Receive flag
{
RI=0; software clear
buf=SBUF; Get a byte
}
SBUF=buf; send data
while(!TI); Determine whether to send
}
Previous article:CT107D Blue Bridge Cup dynamic digital tube example (4)
Next article:CT107D Bluebridge Buzzer and Relay (2)
- 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?
- Vicor high-performance power modules enable the development of low-altitude avionics and EVTOL
- Chuangshi Technology's first appearance at electronica 2024: accelerating the overseas expansion of domestic distributors
- Chuangshi Technology's first appearance at electronica 2024: accelerating the overseas expansion of domestic distributors
- "Cross-chip" quantum entanglement helps build more powerful quantum computing capabilities
- Ultrasound patch can continuously and noninvasively monitor blood pressure
- Ultrasound patch can continuously and noninvasively monitor blood pressure
- Europe's three largest chip giants re-examine their supply chains
- Europe's three largest chip giants re-examine their supply chains
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- PIC mid-range microcontroller series-10-bit AD converter
- Buck charger bq25700
- A method to improve the distance measurement accuracy by using shaping filter bank
- POWER MANAGEMENT SETUP Power Management Setup
- Prospects for the development of microwave power applications in the new century
- As system design turns to chip suppliers, how can OEMs achieve product value-added?
- [Help] Where can I download Tong Shibai's analog circuit tutorial?
- EEWORLD University Hall----Live Replay: TI innovates next-generation automotive gateway system
- Reliability of DC-DC power modules
- Problems that should be paid attention to when using TTL circuits