如题代码是从79f6441的demo代码串口0改
void Uart_Test()
{
init_uart();
while(1)
{
SBUF1=0x96;
while(!TI1);
TI1=0;
}
while(1);
}
void init_uart()
{
CLKCON =0x08;
Delay();
CLKCON|=0x06;
UART1CR = 0x10;
IEN1 = 0;
IENC = 0;
// 配置模式1
SCON1=0x50;
/*波特率9600*/
SBRTH1=0xff;
SBRTL1=0x64;
SFINE1=0x04;
} |