The serial communication experiment between the microcontroller and the PC includes the DSN .C .HEX file
source program:
#include
sbit button=P3^5;
void init_tx()
{
TMOD=0x20;
TH1=0xfd;
TL1=0xfd;
PCON=0x00;
SCON=0x40;
EA=1;
EN=1;
EX1=1;
IF = 0;
EX1=1;
IT1=0;
TR1=1;
}
void main()
{
init_tx();
while(1)
{
if(button==0)
{
SBUF=0x01;
while(TI==0);
IF = 0;
while(button==0);
}
}
}
Previous article:C51: General, memory pointer
Next article:AT24C01-AT24C256 general source program (C51)
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- [TI recommended course] #[High Precision Lab] ADC Series 5: ADC Frequency Domain Indicators#
- Please provide the equation for the LC series resonant circuit plus a rectangular wave, thank you.
- GD32E230C Display Variables
- I would like to ask about the LCD configuration of Imx6ull
- Arduino - 315/433MHz RF Wireless Transceiver Module
- Design of semiconductor laser power supply for intelligent control
- What is the voltage when the voltage is broken from left to right?
- Is there any level conversion chip that can directly convert 24V signal to 5V?
- Analysis of the problem of unstable signal and no output when connected to power on of wireless pressure sensor
- What does this code mean?