我写了个简单的中断程序,但是为什么不能进入中断?
#include<reg51.h>
void timer0(void) interrupt 1 using 2{
flag=0;
TH1=(65536-46083)/256;
TL1=(65536-46083)%256;
}
void main(void)
{
flag=1;
P1=0xff;
TMOD=0X10;
TH1=(65536-46083)/256;
TL1=(65536-46083)%256;
EA=1;
ET1=1;
TR1=1;
while(1)
{
while(flag==0){
P1=0XFd;
flag=1;
}
}
} |