为什么我的数码管动态显示非常快,单片机是CT170D,怎么让他隔500ms显示一个一个显示啊
#include <STC15F2K60S2.H>
#define uchar unsigned char
#define uint unsigned int
uchar code tabledu[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0x91,0x86,0x8e};
uchar code tablewei[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
uint tt,num,num1;
void init()
{
TMOD=0X01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
P2=0X80;
P0=0XFF;
}
void main()
{
init();
while(1);
}
void extor0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
if(tt=200)
{
tt=0;
P2=0XC0;
P0=tablewei[num1];
P2=0XF0;
num1++;
if(num1==8)
num1=0;
P2=0XE0;
P0=tabledu[num];
P2=0XF0;
num++;
if(num==16)
num=0;
}
}