普中51单片机,数码管显示0-9,数字一直不完全显示是怎么回事。程序如下
#include<reg51.h>
unsigned char Tab[]={0xc0,0xf9,0xa0,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
unsigned int n=0,m=0;
void main()
{
EA=1;
ET1=1;
TMOD=0x20;
TR1=1;
TH1=(256-250);
TL1=(256-250);
P2=0x01;
while(1)
{
}
}
void timer() interrupt 3
{
n++;
if(n==4000)
{
m++;
P0=~Tab[m-1];
n=0;
}
if(m==10)
m=0;
TF1=0;
}