第1个回答 2020-03-12
你得有时间间隔的发送,比如20ms就可以了,放到while
中一直发,就不会产生中断了。
你可以在定时器加一个标志位,
bit
timer_bit;
void
time0()
interrupt
1
{
th0=(65536-50000)/256;
tl0=(65536-50000)%256;
count++;
if(count>20)
{
count=0;
sec++;
timer_bit=1;
}
}
main()
{
intiall();
while(1)
{
if(timer_bit)
{
timer_bit=0;
sendtime(sec);
}
}
}