数字万年历设计与实现

  • 格式:doc
  • 大小:2.03 MB
  • 文档页数:62

成都理工大学工程技术学院毕业论文

数字万年历设计与实现

作者姓名:陈 立 国

专业名称:电气工程及其自动化

指导教师:孙 莉 莉 讲师 数字万年历设计与实现

- II -

摘要

电子万年历是一种非常广泛日常计时工具,对现代社会越来越流行。它可以对年、月、日、周、时、分、秒进行计时,还具有闰年补偿等多种功能。

电子万年历设计是基于单片机进行的,可以显示年、月、日、时、分、秒、周及温度信息,具有可调整日期和时间功能。设计包含AT89S52单片机模块、LCD数码管模块、键盘模块、DS1302模块、数字式温度传感器DS18B20模块。AT89S52单片机作为核心,功耗小,能在3V的低压工作,电压可选用3~5V电压供电。LCD数码管动态扫描,对于显示数字最合适,价格适中,而且采用动态扫描法与单片机连接时,占用的单片机口线少。DS1302的使用寿命长,误差小。对于数字电子万年历采用直观的数字显示,可以同时显示年、月、日、周日、时、分、秒和温度等信息,还具有时间校准等功能。数字式温度传感器DS18B20仅需要一条数据线进行数据传输,易与单片机连接简化系统电路.数字式温度传感器还具有测量精度高、测量范围广等优点。

关键词 :AT89S52 DS1302 DS18B20 LED数码管

数字万年历设计与实现

- III -

Abstract

Electronic calendar day time is a very wide range of tools, the more

popular in modern society more and. It can be years, months, days, weeks,

hours, minutes and seconds for time, but also has a leap year compensation

and other functions.

Electronic calendar design is based on SCM, can display year, month,

day, time, minutes and seconds, week and temperature information, which

can adjust the date and time functions. Design including AT89S52 MCU

module, LCD digital tube module, keyboard module, DS1302 module,

digital temperature sensor DS18B20 module. AT89S52 microcontroller as

the core, small power consumption, can work in low-voltage 3V, voltage

can choose 3~5V voltage supply. LED digital tube dynamic scanning, the

most suitable for digital display, moderate price, and using dynamic

scanning method is connected with the MCU, microcontroller port occupied

less lines. DS1302 has a long service life, small error. For digital electronic

calendar using visual digital display, can display year, month, day, Sunday,

when, minutes and seconds and temperature information, but also a time

calibration functions. Digital temperature sensor DS18B20 requires only

one data line for data transmission, easy to be connected with the single-chip microcomputer to simplify the system circuit. The digital temperature

sensor has high measuring precision, wide measuring range etc.

Keywords: AT89S52, DS1302, DS18B20, digital tube LED

数字万年历设计与实现

- IV -

目录

摘要 .......................................................................................................... II

Abstract ................................................................................................... III

目录 ......................................................................................................... IV

前言 ........................................................................................................... 1

1总体设计方案 ......................................................................................... 2

1.1 设计方案 ..................................................................................... 2

1.2 方案比较论证 ............................................................................. 2

1.3 总体设计方框图 ......................................................................... 3

2设计原理与分析 ..................................................................................... 4

2.1 单片机主控制器 ......................................................................... 4

2.2 温度传感器芯片 ......................................................................... 5

2.3 时钟芯片DS1302 ........................................................................ 9

2.4 16*2LCD液晶显示1602 ............................................................ 12

3硬件电路 ............................................................................................... 16

3.1 单片机主控制模块的设计 ....................................................... 16

3.2 时钟电路模块的设计 ............................................................... 16

3.3 温度采集模块设计 ................................................................... 17

3.4 功能按钮设计 ........................................................................... 18

3.5 16*2 LCD1602液晶显示电路设计 ........................................... 18

4系统软件设计 ....................................................................................... 20

4.1 系统模块的功能分划分 ........................................................... 20

4.2 总体程序流程框图 ................................................................... 20

4.3 时钟调整时间的流程图 ........................................................... 21

4.4 温度转换流程图 ....................................................................... 22

总结 ......................................................................................................... 24