1、 毕业论文 设计 题 目 : 基于单片机的数字万年历设计 学生姓名 : 郑得利 学生学号 : 0908040147 系 别 : 电气信息工程学院 专 业 : 通信工程 届 别 : 2013 届 指导教师 : 朱士永 成绩 淮南师范学院电气信息工程学院 2013 届通信工程专业毕业论文 第 1 页 基 于单片机的数字万年历设计 学生: 郑得利 指导教师: 朱士永 淮南师范学院 电气信息工程学院 摘 要 : 本文借助电路仿真软件 Protues 对基于 AT89S51 单片机的电子万年历的设计方法及仿真进行了全面的阐述。该电子万年历在硬件方面主要采用 AT89C51 单片机作为主控核心,由 DS1
2、302时钟芯片提供时钟、 1602LCM 点阵液晶显示屏显示。 AT89C51 单片机是由 Atmel 公司推出的,功耗小,电压可选用 4 6V 电压供电; DS1302 时钟芯片是美国 DALLAS 公司推出的具有涓细电流充电功能的低功耗实时时钟芯片,它可 以对年、月、日、星期、时、分、秒进行计时,还具有闰年补偿等多种功能,而且 DS1302 的使用寿命长,误差小;数字显示是采用的 LED 液晶显示屏来显示,可以同时显示年、月、日、星期、时、分、秒等信息。此外,该电子万年历还具有时间校准等功能。在软件方面,主要包括日历程序、时间调整程序,显示程序等。所有程序编写完成后,在 Keil 软件中进
3、行调试,确定没有问题后,在 Proteus 软件中嵌入单片机内进行仿真。 论文主要研究了液晶显示器 LCM 及时钟芯片 DS1302,温度传感器 DS18B20 与单片机之间的硬件互联及通信,对数种 硬件连接方案进行了详尽的比较,在软件方面对日历算法也进行了论述。 研究结果表明,由于万年历的应用相当普遍,所以其设计的核心在于硬件成本的节约软件算法的优化,力求做到物美价廉,才能拥有更广阔的市场前景。 关键词: 单片机; DS1302; DS18B20; LCM1602 Design of the digital Perpetual Calendar based on Single chip mi
4、crocomputer Student: delizheng tutor: yongshizhu Institute of electrical and information engineering of huainan normal university ABSTRACT: This paper mainly discuss the design and simulation of electronic calender based on AT89S51 with the help of Protues.On the hardware side, the electronic calend
5、ar using AT89C51 microcontroller as the main control center, clock provided by the DS1302 clock chip , 1602LED dot matrix LCD display.Atmel Corporation AT89C51 microcontroller is producted by Atmel Corporation, 淮南师范学院电气信息工程学院 2013 届通信工程专业毕业论文 第 2 页 low power consumption, voltage can be selected 4V 6
6、V voltage power supply; DS1302 clock chip, launched in the United States with DALLAS small current charging function real time clock chip, low power consumption, it can be years , month, date, day, hour, minute, seconds time, also has a leap year compensation and other functions, and DS1302 long lif
7、e, small error; LED digital display is used in LCD displays that can display in , month, day, week, hours, minutes, seconds and other information.In addition, the electronic calendar is also a time calibration functions. In terms of software, including calendar program, time to adjust procedures, di
8、splay procedures. All programming is complete, the Keil software debugging, make sure there is no problem, in the Proteus software embedded within the simulated MCU. This article focus on liquid crystal screen LCM1602 and clock chip DS1302,temperature sensor DS18B20 which connected and communicated
9、with Microcontroller.Several solutions will also compared with each other.On software side, calender calculation will be discussed as well. The results are as follows:as electronic calender are widely used in our daily life.It should be chip and convenient so as to win more profit. Keyword: Microcon
10、troller,DS1302; DS18B20; LCD1602 目 录 前言 . 3 1 方案设计 . 4 1.1 概述 . 4 1.1.1 实时时钟 研究的背景及意义 . 4 1.1.2 系统的总体设计 . 5 1.2 系统基本方案选择和论证 . 6 1.2.1 单片机芯片的选择 . 6 1.2.2 显示模块选择方案和论证 . 6 1.2.3 时钟芯片的选择方案和论证 . 6 1.2.4 电路设计最终方案决定 . 7 2 硬件电路设计 . 7 2.1 系统硬件概述 . 7 2.2 单片机最小系统 . 8 2.3 单片机的复位电路 . 9 2.4 时钟芯片电路 . 11 2.4.1 时钟芯片引脚介绍 . 11 2.4.2 时钟芯片 DS1302 介绍 . 12 2.5 1602LCD 液晶显示屏 . 13 2.5.1 1602 字符型 LCD 简介 . 13 2.5.2 1602 引脚功能说明 . 13 2.6 蜂鸣器闹铃电路 . 14 2.7 按键调整电路 . 14