大虾们,麻烦帮我找找错麻烦帮我看看程序,编译通过,为什么串口没有产生中断啊
#include <reg51.H>
sbit WDI = P3^3; /* watchdog */
sbit DIR = P3^2;
unsigned char i;
main()
{
P1 = P0 = 0; /* Pins of output initialize */
IT0 = 1; /* Exte interrupt initialize */
IT1 = 1; /* 0 = Low,1 = Down */
/* Serial port initialize */
SCON = 0x50; /* 0111 0000,Model 1 */
PCON = 0x80; /* n = 16 */
/* Timer initialize */
TMOD = 0x20; /* 0010 0001,timer0 mode1,timer1 mode 2 */
TH1 = TL1 = -6; /* MCLK = 11.0592M,BD = 9.6K,16 times */
TR1 = 1;
IP = 0x10; /* 0001 0000 */
TI = 0;
RI = 0;
IE = 0x92; /* 1001 0010 */
while(1){
WDI=0;
WDI=1;
for(i=0;i <250;i++);
for(i=0;i <250;i++);
}
}
serial() interrupt 4 using 1 {
if(RI)
{RI=0;
for(i=0;i <250;i++);
SBUF=0x7e;
while(!TI);TI=0;
for(i=0;i <250;i++);
}
WDI=0;
WDI=1;
for(i=0;i <250;i++);
if(TI)
{TI=0;
SBUF=0x8a;
while(!TI); TI=0;
for(i=0;i <250;i++);
}
}