#include
sfr AUXR = 0x8E;
void InitUART(void)
{
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xB2;
TL1 = TH1;
PCON = 0x80;
EA = 1;
ES = 1;
TR1 = 1;
}
void SendOneByte(unsigned char c)
SBUF = c;
while(!TI);
TI = 0;
void main(void)
AUXR = AUXR|0x40; // T1, 1T Mode
InitUART();
void UARTInterrupt(void) interrupt 4
if(RI)
RI = 0;
//add your code here!
else
#include
sfr AUXR = 0x8E;
void InitUART(void)
{
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xB2;
TL1 = TH1;
PCON = 0x80;
EA = 1;
ES = 1;
TR1 = 1;
}
void SendOneByte(unsigned char c)
{
SBUF = c;
while(!TI);
TI = 0;
}
void main(void)
{
AUXR = AUXR|0x40; // T1, 1T Mode
InitUART();
}
void UARTInterrupt(void) interrupt 4
{
if(RI)
{
RI = 0;
//add your code here!
}
else
TI = 0;
}