摘要:电子万年历是单片机系统的一个应用,由硬件和软件相配合使用。硬件由主控器、时钟电路、温度检测电路、显示电路、键盘接口5个模块组成。主控模块用AT89S52、时钟电路用时钟芯片DS1302、显示模块用LCD数码管、温度检测采用DS18B20温度传感器、键盘接口电路用普通按键接上拉电阻完成;软件利用C语言编程实现单片机程序控制。单片机通过时钟芯片DS1302获取时间数据,DS18B20采集温度信号送该给单片机处理,单片机再把时间数据和温度数据送给74LS154译码,然后通过三极管C9015放大驱动LCD数码管显示阳历年、月、日、时、秒、闹钟、星期、温度。
关键词 电子万年历;单片机;温度传感器;时钟;数码显示
Abstract:Electronic perpetual calendar which is an application of the single-chip processor system, is utilized by combining hardware and software. And Hardware is composed of five modules: Main control unit, clock circuit, temperature test circuit, display circuit, keyboard interface. Main control board adopts AT89S52, clock circuit adopts the DS1302 clock chip, display module adopts the LCD digital tube, and temperature test adopts the DS18B20 temperature sensor, keyboard interface circuit is completed by connecting ordinary button with pull-up resistor. Software takes advantage of C to program, so as to realize the programmed control of single-chip processor. Single-chip processor gets the time data through using the DS1302 clock chip. The DS18B20 gathers temperature signals and transmits them to single-chip processor. Then, single-chip processor transmits the time data and the temperature data to the 74LS154 decoder. Lastly, the LCD displays solar calendar year, year, month, day, hour, minute, second, alarm clock, week and temperature with being enlarged and driven by the C9015 triode.
Keywords Electronic perpetual calendar single-chip processor temperature sensor clock digital display
二十一世纪是电子科技高速发展的时代,其中单片机扮演着不可或缺的角色。电子万年历的研究和发展在当今时代仍是一项不断探索的课题。因为它广泛应用于人们的日常生活,在学校,企事业单位,办公大厅,车站广场等场所遍及它们的足迹,融于社会各个角落,满足人们各项基本生活需求,同时给社会管理带来了极大的便利。
本课程设计硬件由主控器,时钟电路,温度检测电路和显示电路几个模块组成。主控模块用AT89S52单片机,时钟电路用时钟芯片DS1302,显示模块用LCD液晶显示,接口比较简单,断电不会失去时间和数据信息,功耗低,性能高,解决了目前常用实时时钟占有单片机资源多以及计时不可靠等缺点。在很多领域应用中,特别是对时钟精确性和可靠性有较高要求的场合,具有很高的应用价值。