1、 I 基于 51 单片机的电子万年历设计 摘 要 电子万年历是一种非常广泛日常计时工具,对现代社会越来越流行。它可以对年、 月、日、周日、时、分、秒进行计时,还具有闰年补偿等多种功能,而且 DS1302 的使 用寿命长,误差小。对于数字电子万年历采用直观的数字显示,可以同时显示年、月、 日、周日、时、分、秒和温度等信息,还具有时间校准等功能。该电路采用 AT89C52 单 片机作为核心,功耗小,能在 3V 的低压工作,电压可选用 35V 电压供电。 万年历的设计过程在硬件与软件方面进行同步设计。硬件部分主要由 AT89C52 单 片机,LED 显示电路,以及调时按键电路等组成。为了能更轻松的控
2、制这三片显示器, 本人使用了 3 片 74HC164 来驱动。74HC164 是 8 位边沿触发式移位寄存器,串行输入 数据,然后并行输出。软件方面主要包括日历程序、时间调整程序,公历转阴历程序, 显示程序等。程序采用 C 语言语言编写,以便更简单地实现调整时间及阴历显示功能。 所有程序编写完成后,在 keil uvision4 软件中进行调试好后,在 Proteus 软件中进行 仿真。 关键词: DS1302; DS18B20; 动态扫描; 单片机 II Electronic calendar design based on 51 MCU Abstract Electronic calend
3、ar day time is a very wide range of tools, increasingly popular in modern society. It can be timed to the year, month, day, Sunday, when, minutes and seconds, also has a leap year compensation and other functions, and the DS1302s long life, small error. For the digital electronic calendar using visu
4、al digital display, can display year, month, day, Sunday, when, minutes and seconds, and temperature and other information, is also a time-calibration functions. The circuit uses AT89C52 microcontroller as the core, power consumption is small, can work in low-voltage 3V, voltage can choose 35V suppl
5、y voltage. The design process of the calendar synchronization in the hardware and software design. Hardware mainly by the AT89C52 microcontroller, LED display circuit, and when the key circuits etc In order to the three display control more relaxed, I used 3 pieces of 74HC164 to drive. 74HC164 is a
6、8 bit edge-triggered shift register, serial input data, and then the parallel output. The software includes calendar program, time to adjust the procedure, turn the lunar calendar program, display program. Using C language, in order to more easily adjust the time and calendar display function. All programming is complete, the Keil for debugging uvision4 software, make sure there is no problem, embedded microcontroller simulation in Proteus software. Key words: DS1302; DS18B20; Dynamic s