如题,N76E003能进入UART中断,但测不到波形是怎么回事?请大侠指导!
我发送一个字符,或多个字符都能成功进入中断,但测量TX就是没波形(RX我也测了,因为芯片有RX/TX交换的功能)
程序如下:
void SerialPort0_ISR(void) interrupt 4
{
if(TI==1)
{
clr_TI; /* if emission occur */
}
}
void main (void)
{
CKSWT = 0;
CKEN = 0x20;
CKDIV = 0;
AUXR1 = 0;
P0 = 0xff;
P0M1 = 0x27;
P0M2 = 0x18;
P0S = 0xff;
P0SR = 0;
IE =0x10;
IP =4;
IPH =2;
EIP =4;
EIPH=4;
EIP1=0;
EIPH1=0;
TCON=4;
TMOD = 0x20;
TH1 = 256 - (1000000/9600+1);
TR1 = 1;
SCON = 0x50;
set_SMOD; //UART0 Double Rate Enable
set_T1M; //Sys clock no divider
clr_BRCK; //select Timer1
TI =0;
EA =1;
SBUF = 0xa5;
while(1);
}
|
|