Home > other >  Between the single-chip microcomputer serial port to send hexadecimal digits, why there will be a bl
Between the single-chip microcomputer serial port to send hexadecimal digits, why there will be a bl

Time:09-23

#include
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 answer

CodePudding user response:

Waiting for a great god answer

CodePudding user response:

Wait wait wait

CodePudding user response:

Hexadecimal display space is a serial port assistant producers themselves, presumably to convenient for observation

CodePudding user response:

Ok, thank you very much

CodePudding 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 blank

CodePudding user response:

Hexadecimal receiving you use, the computer software for your good reading, choose to insert additional space, is not practical
  • Related