基于单片机at89s52的电子实时时钟万年历系统内容摘要:

分若小于则转退出 mov secH,00h。 否则清 0 mov secL,00h。 ftiao2: ljmp outout。 zhwei2: cjne a,02h,gwei2。 mov r1,minH。 lcall add1。 mov a,r3。 cjne a,60h,outout。 mov minH,00h。 mov minL,00h。 ljmp outout。 gwei2: cjne a,03h,outout。 mov r1,hourH。 lcall add1。 mov a,r3。 cjne a,24h,outout。 mov hourH,00h。 mov hourL,00h。 ljmp outout。 naozhtz:mov a,51h。 cjne a,01h,zhwei3。 mov r1,als_h。 lcall add1。 mov a,r3。 cjne a,60h,ftiao3。 分若小于则转退出 mov als_h,00h。 否则清 0 mov als_l,00h。 ftiao3: ljmp outout。 zhwei3: cjne a,02h,gwei3。 mov r1,alm_h。 lcall add1。 mov a,r3。 cjne a,60h,outout。 mov alm_h,00h。 mov alm_l,00h。 ljmp outout。 gwei3: cjne a,03h,outout。 mov r1,alh_h。 lcall add1。 mov a,r3。 cjne a,24h,outout。 mov alh_h,00h。 mov alh_l,00h。 ljmp outout。 naoling。 naoling1:push acc。 setb mov a,31h。 cjne a,41h,out6。 mov a,30h。 cjne a,40h,out6。 mov a,33h。 cjne a,43h,out6。 mov a,32h。 cjne a,42h,out6。 mov a,35h。 cjne a,45h,out6。 mov a,34h。 cjne a,44h,out6。 nao: clr lcall display jnb ,stopnao sjmp nao stopnao: lcall dl30ms mov P0,0ffH out6: pop acc。 lcall display。 ret。 整点报时。 zhengdi: push acc。 mov a,31h。 cjne a,00h,out7。 mov a,30h。 cjne a,00h,out7。 mov a,33h。 cjne a,00h,out7。 mov a,32h。 cjne a,00h,out7。 mov a,0ah。 clr。 clr lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 lcall display。 setb。 setb out7: pop acc。 lcall display。 ret。 **************************************************。 函数名:。 功能: 串口发送数据函数。 传入参数: 无。 传出参数: A。 ************************************************** chuan: MOV A,p0。 读取 P1 口数据 MOV SBUF,A JNB TI,$。 等待发送完毕 CLR TI lcall dl30ms。 wait: jnb ri,out9。 MOV A,SBUF CLR RI sjmp out10。 out9: lcall display。 jmp chuan。 out10: ret。 **************************************************。 函数名: chxianshi。 功能: 显示调整函数。 传入参数: 无。 传出参数:。 ************************************************** chxianshi: lcall dl30ms。 jb ,set2。 set1: jnb ,set1。 lcall chuan。 mov a,50h。 cjne a,00h,nianfen mov a,01h。 mov 50h,a。 sjmp set2。 nianfen: cjne a,01h,naoling。 mov a,02h。 mov 50h,a。 sjmp set2。 naoling: cjne a,02h,maobiao。 mov a,03h。 mov 50h,a。 sjmp set2。 maobiao: mov a,00h。 mov 50h,a。 set2: lcall display。 out: ret。 **************************************************。 函数名: k2。 功能: 调整位移位函数。 传入参数: 无。 传出参数:。 ************************************************** k2: lcall dl30ms。 jb ,set11。 判断是否有键按下 set10: jnb ,set10。 lcall chuan。 mov a,51h。 cjne a,00h,zliang mov a,01h。 mov 51h,a。 sjm。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。