新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 6位数字显示频率计数器电路及51单片机源程序

6位数字显示频率计数器电路及51单片机源程序

作者:时间:2012-05-25来源:网络收藏

while(1)

{

if(flag==1)

{

flag=0;

x=T0count*65536+TH0*256+TL0;

for(i=0;i8;i++)

{

temp[i]=0;

}

i=0;

while(x/10)

{

temp[i]=x;

x=x/10;

i++;

}

temp[i]=x;

for(i=0;i6;i++)

{

dispbuf[i]=temp[i];

}

timecount=0;

T0count=0;

TH0=0;

TL0=0;

TR0=1;

}

}

}

void t0(void) interrupt 1 using 0

{

T0count++;

}

void t1(void) interrupt 3 using 0

{

TH1=(6553*000)/256;

TL1=(6553*000)%6;

timecount++;

if(timecount==250)

{

TR0=0;

timecount=0;

flag=1;

}

P0=dispcode[dispbuf[dispcount]];

P2=dispbit[dispcount];

dispcount++;

if(dispcount==8)

{

dispcount=0;

}

}

51单片机相关文章:51单片机教程


尘埃粒子计数器相关文章:尘埃粒子计数器原理

上一页 1 2 下一页

评论


相关推荐

技术专区

关闭