为什么我的定时器调用不了啊
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
uchar tab2[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
uchar t1[1];
uchar t2[1];
uchar sum=0;
sbit P22=P2^2; //段
sbit P23=P2^3;
sbit P24=P2^4;
sbit P10=P1^0; //东西 红 黄 绿
sbit P11=P1^1;
sbit P12=P1^2;
sbit P14=P1^4; //南北 红 黄 绿
sbit P15=P1^5;
sbit P16=P1^6;
sbit P31=P3^1; //按键
sbit P30=P3^0;
sbit P32=P3^2;
sbit P33=P3^3;
void delay(uint ms) //延时
{
int i,j;
for(i=0;i<ms;i++)
for(j=0;j<120;j++);
}
void smxs( uchar ws, sum )
{
switch(ws)
{
case 1: P22=0; P23=0; P24=0; break;
case 2: P22=1; P23=0; P24=0; break;
case 3: P22=0; P23=1; P24=0; break;
case 4: P22=1; P23=1; P24=0; break;
case 5: P22=0; P23=0; P24=1; break;
case 6: P22=1; P23=0; P24=1; break;
case 7: P22=0; P23=1; P24=1; break;
case 8: P22=1; P23=1; P24=1; break;
}
P0=tab2[sum];
}
void time_0()
{
TMOD=0x01;
TH0=0X3c;
TL0=0Xb0;
TR0=1;
EA=1;
ET0=1;
}
void main()
{
time_0();
t1[1]=sum/10;
t1[0]=sum%10;
smxs(1,t1[0]);
delay(1);
smxs(2,t1[1]);
delay(1);
}
void t0()interrupt 1
{
static uchar counter=0;
TH0=0X3c;
TL0=0Xb0;
counter++;
if(counter>20)
{ sum++;
counter=0;
}
}