Unsigned char flag, a;
Void main ()
{
TMOD=0 x20;//set the timer 1 is the way to work 2
TH1=0 XFD;//initial value, the timer 9600 baud rate
TL1=0 XFD;
TR1=1;
REN=1;
SM0=0;//set the serial port to work 1
The SM1=1;
EA=1;
ES=1;
While (1)
{
If (flag==1)
{
ES=0;
Flag=0;
SBUF=a;
while(! TI);
TI=0;
ES=1;
}
}
}
Void ser () interrupt 4
{
RI=0;
A=SBUF;
Flag=1;
}
CodePudding user response:
Waiting for a great god answerCodePudding user response:
Waiting for a great god answerCodePudding user response:
Wait wait waitCodePudding user response:
Hexadecimal display space is a serial port assistant producers themselves, presumably to convenient for observationCodePudding user response:
Ok, thank you very muchCodePudding user response:
Void ser () interrupt 4
{
If (RI==1)
{
RI=0;
A=SBUF;
Flag=1;
}
}
Send will trigger a serial port interrupt
CodePudding user response:
But began to appear is no Spaces, succeeding to appear blankCodePudding user response:
Hexadecimal receiving you use, the computer software for your good reading, choose to insert additional space, is not practical