This program has some not bright digital tube, please help eldest brother, see
#include<1620. H>
#include
#include
# define disMode 0 x00//mode selection
# define dtOrd 0 x40
# define disCon 0 x80
# define adrOrd 0 x84
//disMode config
# define four_du 0 x00
# define five_du 0 x01
# define six_du 0 x02
//dataOrd
# define adrAdd 0 x40
# define adrFix 0 x44
//disCon_Ord
# define bright_close 0 x80
# define bright_level1 0 x88
# define bright_level2 0 x89
# define bright_level3 0 x8a
# define bright_level4 0 x8b
# define bright_level5 0 x8c
# define bright_level6 0 x8d
# define bright_level7 0 x8e
# define bright_level8 0 x8f
//adrMod_con
# define adr00H 0 xc0
# define adr01H 0 xc1
# define adr02H 0 xc2
# define adr03H 0 xc3
# define adr04H 0 xc4
# define adr05H 0 xc5
# define adr06H 0 xc6
# define adr07H 0 xc7
# define adr08H 0 xc8
# define adr09H 0 xc9
# define adr0AH 0 xca
# define adr0BH 0 XCB
Void Delay2us ()//@ 11.0592 MHz
{
Unsigned char I;
I=3;
While (I);
}
Static u8 LED_tab [11]={//define digital tube 0 ~ 9 digital clock
0 x3f,//0 b00111111,//0
0 x30,//0 b00000110,//1
0 x6d,//0 b01011011,//2
0 x79,//0 b01001111,//3
0 x33,//0 b01100110,//4
0 x5b,//0 b01101101,//5
0 x5f,//0 b01111101,//6
0 x70,//0 b00000111,//7
0 x7f,//0 b01111111,//8
0 x7b,//0 b01101111,//9
0 x4f,//E
};
Void Delay1ms ()//@ 24.000 MHz
{
Unsigned char I, j;
I=24;
J=85;
Do
{
While (- j);
} while (I);
}
Void tm1620_write (u8 dt)
{
u8 i;
STB=0;
for(i=0; I<8; I++)
{
CLK=0;
If (dt& 0 x01) DIN=1;
The else DIN=0;
Dt & gt;>=1;
Delay1ms ();
CLK=1;
Delay1ms ();
}
}
Void tm1620_init ()
{
Tm1620_write (six_du);
STB=1;
Delay2us ();
Tm1620_write (adrFix);
STB=1;
Delay2us ();
Tm1620_write (adr00H);
X3f tm1620_write (0);
STB=1;
Delay2us ();
Tm1620_write (adr02H);
X3f tm1620_write (0);
STB=1;
Delay2us ();
Tm1620_write (adr04H);
X3f tm1620_write (0);
STB=1;
Delay2us ();
Tm1620_write (adr06H);
X3f tm1620_write (0);
STB=1;
Delay2us ();
Tm1620_write (bright_level3);
}
CodePudding user response:
Don't light it is possible that the circuit problem, where virtual welding, burning, no electricity, were as of Yin Yang,CodePudding user response:
The board can be sure is good