/*60S倒计时*/
/*个位每1S变一次,从0~9*/
/*十位,个位为0的下一秒十位发生变化*/
#includesbit ADDR0=P1^0;
sbit ADDR1=P1^1;
sbit ADDR2=P1^2;
sbit ADDR3=P1^3;
sbit ENLED=P1^4;
unsigned char code LedChar[]=
{
0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,
0x80,0x90
};
void main()
{
unsigned int cnt=0; //记录中断次数
unsigned int sec=0; //记录秒数
unsigned char g=0; //个位数码管
unsigned char s=6; //十位数码管
ENLED=0; //使能U3 选中数码管DS1
TMOD=0x01; //T0为模式1
TH0=0xB8; //T0赋初值0xB800
TL0=0x00;
TR0=1; //启动T0
while(1)
{
ADDR3=1;
P0=0xff;
ADDR2=0;
ADDR1=0;
ADDR0=0;
P0=LedChar[g]; //选中个位数码管
if(TF0==1) //判断T0是否