1.51单片机不能使用printf输出uchar型数据,其他可以直接printf函数
void UartInit(void) //9600bps@11.0592MHz
{
PCON |= 0x80; //????????SMOD
SCON = 0x50; //8???,?????
TMOD &= 0x0F; //?????1???
TMOD |= 0x20; //?????1?8???????
TL1 = 0xFA; //??????
TH1 = 0xFA; //????????
ET1 = 0; //?????1??
TR1 = 1; //?????1
ES=1;
EA=1;
TI=1;//一定要把这里置为1
}