第一范文网 - 专业文章范例文档资料分享平台

数字电子时钟的设计 - 图文

来源:用户分享 时间:2025/6/3 8:37:16 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

case 0x08; buf[3]=0x0b; break; } }

/*******************************************************/ displa();

if(S1) goto sett_1; for(i=0;<4;i++) delay20ms(); if(S1) goto sett_1; if(ml) {

TR1=0; ET1=0;

buf[0]=hourh; buf[1]=hourl; buf[2]=minuh; buf[3]=minul; return; }

setflag<<1; continue;

sett_1; if(S2) continue; for(i=0;i<4;i++) delay20ms();

if(S2) continue; if(!hh) goto sett_2 { hourh++;

if(hourh!=2) continue; hourh=0; continue; }

sett_2: if(!hl) goto sett_3; {

hourl++;

if(hourh) goto sett_20; if(hourl==10) goto sett_21; continue;

sett_21: hourl=0; continue;

sett_20: if(hourl==3) goto sett_22; continue; sett_22: hourl=0; continue; }

sett_3: if(!mh) goto sett_4; { minuh++;

if(minuh==6) goto sett_30; continue;

sett_30: minuh=0; continue;

}

sett_4: minul++;

if(minul==10) goto sett_40; continue;

sett_40: minul=0;

26

continue; } }

/*********************************************************** ;**********************************************************/ void delay20ms(void) {

uchar i, j;

for(i=0;i<20;i++)

for(j=0;j<255;j++); }

/*********************************************************** ;**********************************************************/ void timerl(void) interrupt 3 using 1 {

TH1=0x3c; /* 100ms 定时常数 */ TL1=0xb0;

conun++; /* 中断次数加1*/

if(count!=5) /* 判到10次(1s)否,不到直接返回 */ return;

ss=!ss; /* ss 闪烁标志求反 */ count=0; }

/********************************************************** ;*********************************************************/ void tl_init(void {

; TMOD=0X11; /*T1 定时方式1*/ TH1=0x3c; TL1=0xb0; }

27

搜索更多关于: 数字电子时钟的设计 - 图文 的文档
数字电子时钟的设计 - 图文.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c4ggvm92q337yqpo85nac_9.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top