1、作品介绍作品介绍 基于基于 STC90C516RD+、DS1302、DS18B20、12864 液晶显示万年历设计液晶显示万年历设计 目 录 目 录 . I Abstract . II 1 概 述 . 1 1.1 系统基本方案选择和论证 1 1.2 电路设计最终方案 3 2 系统的硬件设计与实现 4 2.1 电路设计框图 4 2.2 系统硬件概述 4 2.3 主要单元电路的设计 4 3 系统的软件设计 . 17 3.1 程序流程框图 . 17 3.2 子程序 . 19 4 系统测试 . 20 4.1 硬件测试 . 20 4.2 软件测试 . 20 5 结束语 . 21 参考文献 . 22 附录
2、:程序 . 23 致 谢 . 错误错误! !未定义书签。未定义书签。 I 摘 要 本文借助电路仿真软件Protues对基于STC90C516RD+单片机的电子万年历的设计方法 及下载测试进行了全面的阐述。 该电子万年历在硬件方面主要采用 STC90C516RD+单片机作 为主控核心,由 DS1302 时钟芯片提供时钟、12864 点阵液晶显示屏显示。STC90C516RD+ 单片机是由 Atmel 公司推出的,功耗小,电压可选用 46V 电压供电;DS1302 时钟芯片是 美国 DALLAS 公司推出的具有涓细电流充电功能的低功耗实时时钟芯片,它可以对年、月、 日、星期、时、分、秒进行计时,还
3、具有闰年补偿等多种功能,而且 DS1302 的使用寿命 长,误差小;数字显示是采用的 LED 液晶显示屏来显示,可以同时显示年、月、日、星期、 时、分、秒等信息。此外,该电子万年历还具有时间校准等功能。在软件方面,主要包括 日历程序、时间调整程序,显示程序等。所有程序编写完成后,在 Keil 软件中进行调试, 确定没有问题后,进行下载调试。 论文主要研究了液晶显示器及时钟芯片 DS1302, 温度传感器 DS18B20 与单片机之间的 硬件相互之间通信,对数种硬件连接方案进行了详尽的比较,在软件方面对日历算法也进 行了论述。 研究结果表明,由于万年历的应用相当普遍,所以其设计的核心在于硬件成本
4、的节约 软件算法的优化,力求做到物美价廉,才能拥有更广阔的市场前景。 关键词:单片机 STC90C516RD+;DS1302;DS18B20;12864 II Abstract This paper mainly discuss the design and simulation of electronic calender based on STC90C516RD+ with the help of Protues.On the hardware side, the electronic calendar using STC90C516RD+ microcontroller as the m
5、ain control center, clock provided by the DS1302 clock chip , 12864 dot matrix LCD display.Atmel Corporation STC90C516RD+ microcontroller is producted by Atmel Corporation, low power consumption, voltage can be selected 4V 6V voltage power supply; DS1302 clock chip, launched in the United States wit
6、h 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 life, 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 progra