Connect two SN74HC573 four digital tube (only one), to choose the assignment, the digital display of digital error (1), four, five, such as pictures, painted with a green pen,
Ask god to help analysis and see what is wrong, analysis to go, can't find the reason
sbit duan=P3 ^ 6;
Sbit wei=P3 ^ 7;
Uchar num, x, m, ge;
Uchar code table [10]={xa4 xc0 0, 0 xf9, 0, 0 xb0,
X92 0 x99, 0, 0 x82, 0 xf8, 0 x80, 0 x98};
Void delayms (uint);
Void the display (uchar);
Void main ()
{
TMOD=0 x01;
Xa3 TH0=0;
Xa3 TL0=0;
EA=1;
ET0=1;
TR0=1;
While (1)
{
The display (ge);
}
}
Void the display (uchar ge)
{
Wei=1;
The P2=0 xfe;
Wei=0;
The P2=0 XFF;
Delayms (200);
Duan=1;
The P2=table (ge),
Duan=0;
The P2=0 XFF;
Delayms (200);
}
Void delayms (uint XMS)
{
Uint I, j;
For (I=XMS; I> 0; I -);
For (j=110; J> 0; J -);
}
Void time () interrupt 1
{
Xa3 TH0=0;
Xa3 TL0=0;
m++;
If (m==20)
{
M=0;
num++;
Ge=num % 10;
}
}
CodePudding user response:
Look at the 6 shows a or bPerhaps there are two feet short circuit
CodePudding user response: