基于单片机的电子万年历设计 下载本文

内容发布更新时间 : 2024/6/16 22:15:30星期一 下面是文章的全部内容请认真阅读。

精品文档,下载后可随意编辑!

基于单片机的电子万年历设计

摘 要:本文借助电路仿真软件Protues对基于AT89S52单片机的电子万年历的设计方法及仿真进行了全面的阐述。该电子万年历在硬件方面主要采用AT89S52单片机作为主控核心,由DS1302时钟芯片提供时钟、12864LCD液晶显示屏显示。在软件方面,主要包括日历程序、时间调整程序,显示程序等。所有程序编写完成后,在Keil软件中进行调试,确定没有问题后,在Proteus软件中进行电路设计并仿真。

论文主要研究了液晶显示器LCD及时钟芯片DS1302,温度传感器DS18B20与单片机之间的硬件互联及通信,对数种硬件连接方案进行了详尽的比较,在软件方面对日历算法也进行了论述。

研究结果表明,由于万年历的应用相当普遍,所以其设计的核心在于硬件成本的节约软件算法的优化,力求做到物美价廉,才能拥有更广阔的市场前景。 关键词:单片机;DS1302;DS18B20;LCD12864

The Design Of Electronic Calender Based On MCU

Abstract:This paper mainly discuss the design of electronic calender based on AT89S52 with the help of Protues.On the hardware side, the electronic calendar using AT89S52 microcontroller as the main control center, clock provided by the DS1302 clock chip , 12864LCDdot matrix LCD display. In terms of software, including calendar program, time to adjust procedures, display 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 LCD12864 and clock chip DS1302,temperature sensor DS18B20 which connected and communicated 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.

精品文档,下载后可随意编辑!

Keywords:Microcontroller,DS1302;DS18B20;LCD12864

目 录

1 引言............................................................................................................................ 1

1.1课题的背景、目的和意义.............................................................................. 1 1.2课题设计的主要内容...................................................................................... 2 2 课题设计方案............................................................................................................ 2

2.1 系统的总体方案 .............................................. 2 2.2温度传感器的选择............................................. 3

2.2.1 温度传感器的介绍...................................... 3 2.2.2 DS18B20简介 .......................................... 4 2.2.3 DS18B20的工作原理 .................................... 5 2.3微控制器的选择............................................... 6

2.3.1 AT89S52的简介 ......................................... 6 2.3.2 AT89S52的引脚及性能 ................................... 7 2.4显示方式的选择............................................... 8

2.4.1 12864液晶的简介 ....................................... 8 2.4.2 12864液晶的结构及原理 ................................. 9 2.5时钟芯片的选择.............................................. 12

2.5.1 DS1302的介绍 ......................................... 12 2.5.2 DS1302的工作原理及应用 ............................... 12 2.6蜂鸣器及键盘的选择.......................................... 16 3系统硬件电路的设计............................................................................................... 16

3.1 AT89S52单片机系统.................................................................................... 17 3.2 温度采集电路的设计................................................................................... 18 3.3 DS1302实时时钟电路设计.......................................................................... 19 3.4 LCD126864液晶显示设计............................................................................ 19 3.5键盘和蜂鸣器电路设计................................................................................ 20 3.6系统原理图设计............................................................................................ 21 4 系统软件详细设计.................................................................................................. 21

精品文档,下载后可随意编辑!

4.1 开发软件介绍............................................................................................... 21 4.2 主程序设计................................................................................................... 22 4.3 DS1302实时时间流程.................................................................................. 23 4.4温度采集子程序设计.................................................................................... 24 4.5 LCD12864显示子程序设计.......................................................................... 25 4.6键盘及蜂鸣器软件设计................................................................................ 25 5 测试结果及分析...................................................................................................... 26

5.1 硬件及软件综合调试................................................................................. 26 5.2 调试工程中产生的问题及解决................................................................. 27 5.3 测试结果及分析......................................................................................... 27 6 结论.......................................................................................................................... 29 参考文献 ..................................................................................................................... 30 附录 ............................................................................................................................. 31 致谢 ............................................................................................................................. 32