专注电子技术学习与研究
当前位置:单片机教程网 >> MCU设计实例 >> 浏览文章

单片机电子时钟设计

作者:佚名   来源:本站原创   点击数:  更新时间:2007年06月14日   【字体:

介绍了多功能数字钟的系统设计。系统具有时间设置及显示、闹钟、温度显示等功能。系统以 AT89C52为核心,主要进行基于AT89C52低功耗MCU的字符型数字钟及其系统的研究。系统带有液晶显示器,配合按键提供友好的用户界面,操作简单,同时具有温度检测功能,时钟数据和温度数据也可通过RS232向上位机传送。该数字钟能长期、连续、可靠、稳定的工作;同时还具有体积小、功耗低等特点,便于携带,使用方便。系统软件设计包括单片机计算机两部分的编程。计算机软件编程主要实现参数设置、串行口数据接收、指令发送以及数据的显示和存储,采用Visual Basic语言编程。单片机软件编程主要实现键盘、液晶显示、温度检测等各模块的功能,采用C语言编程。该系统通过串行口与计算机通信,计算机给单片机发指令实现数据采集及系统控制,并将数据实时地传回计算机。
关键词:数字钟、液晶显示、温度检测、串口通信
ABSTRACT
This paper describes the design of a multi-functiond digital clock system.It as displaying and setting time for clock and alarm,this system has other special features such as temperature measurement and data protection at power faillure.The core part of the system is based on a king of advanced MCU,AT89C52,this system mainly carries on low power consume MCU the character list type the research of the digital clock and its system according to the AT89 C52.The system takes liquid crystal display, matching with a key to provide amity of customer interface, the operation is simple, having the temperature examination function in the meantime, the clock data and  the temperature data can also heading up a machine transmission through aRS232. consecution,credibility,stable work;Still have a physical volume in the meantime small,the power consume a low etc. characteristics, easy to take, the usage convenience.The system software design includes a single slice a plait distance with two parts of machine calculator.The calculator software plait distance mainly carries out a parameter constitution,string to go a people's data to receive,the instruction send out and data of manifestation with saving, the adoption Visual Basic languageplaitdistance.Singlelicethemachinesoftwareplaitdistance,LCDmanifestation,temperature examination each mold of etc. piece, adoption the C language plait distance.
That system goes and calculator correspondence through a string, the calculator give single slice machine hair the instruction carry out a data to collect and the system control, and is solid the data the ground send back a calculator.
 
 
Key words:digital clock,LCD,Alarm,Temperture displaying
1.    1数字钟的研究的背景及意义
数字钟是采用数字电路实现对.时,分,秒.数字显示的计时装置,广泛用于个人家庭,车站, 码头办公室等公共场所,成为人们日常生活中不可少的必需品,由于数字集成电路的发展和石英晶体振荡器的广泛应用,使得数字钟的精度,远远超过老式钟表, 钟表的数字化给人们生产生活带来了极大的方便,而且大大地扩展了钟表原先的报时功能。诸如定时自动报警、按时自动打铃、时间程序自动控制、定时广播、自动起闭路灯、定时开关烘箱、通断动力设备、甚至各种定时电气的自动启用等,所有这些,都是以钟表数字化为基础的。因此,研究数字钟及扩大其应用,有着非常现实的意义。
  本作品采用Atmel公司的AT89C51单片机,以汇编语言为程序设计的基础,设计一个用四位数码管显示时、分的时钟。在实物图中,左边靠近电源的绿色发光二极管(长亮)是电源指示灯,表示的是5V稳定电源工作正常;单片机左下角红色发光二极管是秒灯,每闪烁一次表示时间走动一秒钟;按键正上方绿色发光二极管是设置灯,当时间正常走动时此时不亮,当第一次按下设置键(右键)时,此绿灯亮,同时秒时熄灭,且分钟的两位数码管出现闪烁,时间停止走动,进入校时状态,表示此时可以进行分钟的调整,当按一次加一键(左键)可实现分钟的加一功能,分钟以60分为极限,超出60分则返回数值0,从0再重新算起;如果再次按下设置键时,这时秒灯和设置灯仍旧保持熄灭和点亮状态,表示分钟的数码管停止闪烁,反过来表示小时的两位数码管则开始闪烁,此时可进行小时的调整,按加1键可实现小时的加1功能,小时调整以24为上限,同样超出24小时则从新回0;当第三次按下设置键时,数码管停止闪烁,设置灯熄灭,秒灯重新闪烁,时间以设定值计时。

 

关闭窗口

相关文章