文档介绍:基于单片机控制的电子万年历的设计
摘要
单片机应用技术飞速发展,纵观我们现在生活的各个领域,从导弹的导航装置,到飞机上各种仪表的控制,从计算机的网络通讯与数据传输,到工业自动化过程的实时控制和数据处理,以及我们生活中广泛使用的各种智能IC卡等,这些都离不开单片机。在本设计中采用单片机AT89C52作为控制器来控制电路。本设计分别对硬、软件进行设计说明。硬件包括制器AT89C52、时钟电路DS1302、显示电路及键盘扫描电路组成,比如DS1302时钟芯片包括实时时钟/日历和31字节的静态RAM。它经过一个简单的串行接口与微处理器通信。实时时钟/日历提供秒、分、时、日、周、月和年等信息。软件部分给出了部分程序流程图的设计,包括阳历程序、时间调整程序和阴历程序。阳历程序是从DS1302各个寄存器中读出年、周、月、日、时、分、秒等数据。时间调整程序时用来正确的执行调整时间的功能。阴历程序的是要靠阳历日期来推算的。推算方法是,根据阳历当前日期在一年中的天数来计算阴历日期。软件编程采用汇编语言编写,因为其简洁、使用方便灵活、容易实现程序的模块化和结构化。
关键词:AT89C52芯片;DS1302芯片;汇编语言;阳历程序;阴历程序
Design of electronic calendar based on single chip puter control
Abstract
puter application technology rapid development, throughout we now all spheres of life, from missile navigation devices, to the aircraft various kinds of instrument control, from munication and data transmission, to industrial automation process real-time control and data processing, as well as our life is widely used in all kinds of intelligent IC card, these are inseparable from microcontroller. In this design USES the monolithic AT89C52 as controller to control circuit. The design of hardware and software respectively design explains. Hardware including making machines AT89C52 single, clocking circuit DS1302, display circuit and keypad scanning ponent, such as DS1302 clock chip including real-time clock/calendar and 31 bytes of static RAM. It passes through a simple serial interface and munications. Real-time clock/calendar provides seconds, points, when, day, week, month and year and other information. Software part gives part of the program flowchart design, including the Gregorian calendar procedure, time adjustment procedures and lunar program. The Gregorian calendar program DS1302 register read from each year, week, month, day, when data such as, minutes and seconds. Time to adjust to the correct implementation program adjusting time functions. Lunar program is to rely on the Gregorian calendar date of extrapolate. Computative method is, according to the solar calendar day