Help everybody look at the following code where is wrong, if use a timer T1 development board has no response, no error message, thank you,
#include
Sbit ADDR0 P1=^ 0;
P1 sbit ADDR1=^ 1;
Sbit ADDR2=p ^ 2;
Sbit ADDR3 P1=^ 3;
Sbit ENLED=P1 ^ 4;
Unsigned char code LedChar []={
Xa4 xc0 0, 0 xf9, 0, 0, xb0 x99 0, 0 x92, 0 x82, 0 xf8,
X90 0 x80, 0, 0 x88, 0 x83, 0 xc6, xa1 0, 0 x86, 0 x8e
};
Unsigned char LedBuff []={
0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF, 0 XFF
};
Unsigned int CNT=0;
Unsigned long SEC=999999;
Unsigned char I=0;
Void main ()
{
ENLED=0;
ADDR3=1;
TMOD=0 x10.
TH1=0 XFC;
TL1=0 x67;
TR1=1;
EA=1;
ET1=1;
While (1)
{
If (cnt>
=1000){
CNT=0;
The SEC -;
LedBuff [0]=LedChar [10] the SEC %;
LedBuff [1]=LedChar SEC/10% 10;
LedBuff [2]=LedChar SEC/100% 10;
LedBuff [3]=LedChar SEC/1000% 10;
LedBuff [4]=LedChar SEC/10000% 10;
LedBuff [5]=LedChar SEC/100000% 10;
}
}
}
Void InterruptTimer0 () interrupt 1
{
TH1=0 XFC;
TL1=0 x67;
cnt++;
P0=0 XFF;
The switch (I)
{
Case 0: ADDR2=0; ADDR1=0; ADDR0=0; i++; P0=LedBuff [0]; ENLED=0; break;
Case 1: ADDR2=0; ADDR1=0; ADDR0=1; i++; P0=LedBuff [1]; ENLED=0; break;
Case 2: ADDR2=0; ADDR1=1; ADDR0=0; i++; P0=LedBuff [2]; ENLED=0; break;
Case 3: ADDR2=0; ADDR1=1; ADDR0=1; i++; P0=LedBuff [3]. ENLED=0; break;
Case 4: ADDR2=1; ADDR1=0; ADDR0=0; i++; P0=LedBuff [4]; ENLED=0; break;
Case 5: ADDR2=1; ADDR1=0; ADDR0=1; i=0; P0=LedBuff [5]; ENLED=0; break;
Default: break;
}
} CodePudding user response:
Appeal for help for help don't sink sink don't sink CodePudding user response:
,,,,,,,,,,,,,,,, CodePudding user response:
You set the digital tube display CodePudding user response: