}
/**********************************************
Receiver receives information
***************************************/
#include
#define uchar unsigned char
#define uint unsigned int
uchar state;
void receive()
{
while(RI==0);
state=SBUF;
RI=0;
}
void SCON_init()//Accept setting function
{
SCON=0X50; //Select serial communication mode 1, allow to accept
TMOD=0x20; //Set counter T1 to counting mode 2 (automatically reload initial value)
PCON=0x00; //Set baud rate multiplication
TH1=0xFD; //The counter works in mode 2, the initial value is stored in the high bit, and it is automatically loaded into TL0 after the count overflows
TL1=0xFD; //Counting unit, starting from FD
RI=0;
TR1=1;
}
void main()
{
SCON_init();
while(1) //wait for acceptance
{
receive();
P2=state;
}
}
Previous article:KeilC51 program for 32*32LED dot matrix screen (based on STC12C5A60S2, 8 large characters)
Next article:Single chip C language frequency meter source code
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
- EEWORLD University Hall - Wildfire uCOS-III Kernel Implementation and Application Development Practical Guide
- mDNS http server redundant array
- Circuit design, simulation and PCB design - from analog circuits, digital circuits, RF circuits, control circuits to signal integrity...
- [Qinheng RISC-V core CH582] Constant temperature control heater
- The brushless drive solution for the 17th Smart Car Competition sponsored by Lingdong is now open source
- Texas Instruments CC1310 Synchronous Transmit and Receive
- 16 Years of Taiwanese New Year
- 【Project Source Code】Digital Signal Processing Learning——Mixer
- Chapter 4: Use of Timers and PWM
- Ask an outrageous question, why do we need to use a resistor to form a discharge path for the capacitor to discharge?