1、 1 课程设计(论文) 题 目 名 称 电子万年历 课 程 名 称 单片机原理及应用 学 生 姓 名 学 号 系 、专 业 信息工程系、通信工程 指 导 教 师 2012 年 5 月 25 日 2 摘 要 电子万年历是一种非常广泛日常计时工具,它可以对年、月、日、周日、 时、分、秒进行计时,还具有闰年补偿等多种功能,对于数字电子万年历采用直 观的数字显示,可以同时显示年、月、日、周日、时、分、秒和温度等信息,还 具有时间校准等功能。 本设计是基于51的单片机进行的电子万年历设计。硬件部分主要由 AT89C52单片机,LED显示电路,以及调时按键电路等组成。在单片机的选 择上使用了AT89C52
2、单片机,显示器使2片7SEG-MPX8-CA和一片 7SEG-MPX4-CA。7SEG-MPX8-CA是一种八个共阳二极管显示器, 7SEG-MPX4-CA是一种四个共阳二极管显示器。为了更轻松的控制这三片显 示器,使用了3片74HC164来驱动。74HC164 是 8 位边沿触发式移位寄存 器, 串行输入数据, 然后并行输出。 软件方面主要包括日历程序、 时间调整程序, 公历转阴历程序, 显示程序等。 所有程序编写完成后, 在wave软件中进行调试, 在Proteus软件中嵌入单片机内进行仿真。 关键词:时钟电钟;DS1302;DS18B20;动态扫描;单片机 3 Abstract Elec
3、tronic calendar is a very extensive daily timing tool, it can be years, months, days, Sunday, hours, minutes and seconds for time, also has a variety of functions such as a leap year compensation, for digital electronic calendar using visual digital display, can display year, month, day, Sunday, whe
4、n, minutes and seconds, and temperature information, also has a time calibration function. The design is based on the 51SCM for the design of electronic calendar. The hardware part is mainly composed of AT89C52SCM, LED display circuit, as well as the timing circuit. In the selection of single chip c
5、omputer on the use of AT89C52 single-chip microcomputer, display so that 2 pieces of7SEG-MPX8-CA and a 7SEG-MPX4-CA. 7SEG-MPX8-CA is a eight common anode diode display,7SEG-MPX4-CA is a four common anode diode display. In order to more easily control the three display, using3 pieces of 74HC164to dri
6、ve. 74HC164 is a 8 bit edge triggered a shift register, serial input parallel output data, and then. Software mainly includes calendar program, time to adjust the procedure, the Gregorian calendar to lunar calendar program, display program. All programming is completed, in the wave software for debugging, in the software of Proteus embedded microcontroller simulation. Key words: clock clock; DS1302; DS18B20; dynamic sca