1、 本科毕业设计(论文)本科毕业设计(论文) 题题 目:目:基于 SPI 总线的数字电子万年历的仿真设计 作作 者:者: 二级学院:二级学院: 电子与信息工程学院 专业班级:专业班级: 电气工程及其自动化(2)班 指导教师:指导教师: 职职 称:称: 高工,讲师 2015 年年 6 月月 10 日日 摘要 本次设计的课题主要内容是多功能数字电子万年历,由于当今社会的飞速发 展,单一的电子时钟已经无法满足人们的日常生活。因此发明一种多功能数字电 子万年历的是一种必然的走向。而本人设计的数字万年历是以 AT89C51 单片机为 中心,通过 DS1302 时钟芯片等辅助芯片来实现在 LCD 上显示年份
2、、月份、日期、 星期、小时、分钟、秒,以及实时温度的显示。该电子万年历通过 4 个按键来调 节日期与时间,通过以软件编程的方式来完成以上各项功能。而这样设计的数字 电子万年历具有成本低廉,使用简单,功能齐全,基本符合当代人的生活需求。 关键词:电子时钟;AT89C51 单片机;辅助芯片;软件编程 ABSTRACT The main subject of the contents of this design is versatile digital electronic calendar, due to the rapid development of todays society, a si
3、ngle electronic clock has been unable to meet peoples daily lives. Therefore, the emergence of multi-function digital electronic calendar is inevitable. And I designed the electronic calendar is based on AT89C51 microcontroller as the core, through the DS1302 clock chip and other auxiliary chip to a
4、chieve is displayed on the LCD the year, month, day, week, hour, minute, second, and real-time temperature display. The electronic calendar by four buttons to adjust the date and time, by way of software programming to accomplish the above functions. And this design of digital electronic calendar wi
5、th low cost, easy to use, full-featured, in line with the needs of contemporary life. Keywords: electronic clock; AT89C51 single chip; chip; software programming 目录 1. 绪论 1 2. 系统概述 2 2.1. 硬件简述 2 2.2. 软件概述 2 3. 系统方案选择及论证 3 3.1. 各项模块的方案选择 3 3.1.1. 单片机型号的选择及论证 3 3.1.2. 时钟芯片的方案选择及论证 3 3.1.3. 温度传感器的方案选择及
6、论证 4 3.1.4. 显示模块的方案选择及论证 4 3.2. 总体方案的确定 4 4. 系统硬件电路的设计 5 4.1. 系统硬件功能及原理介绍 5 4.1.1. AT89C51 单片机的功能及原理 . 5 4.1.2. DS1302 时钟芯片的功能及原理. 8 4.1.3. DS18B20 温度传感器的功能及原理 . 8 4.1.4. LCD1602 液晶显示屏的功能及原理 . 9 4.2. 主要模块电路设计 . 10 4.2.1. 单片机主控制模块设计 . 10 4.2.2. 时钟芯片模块的设计 . 10 4.2.3. 温度传感器模块的设计 . 11 4.2.4. 显示模块的设计 . 12 4.2.5. 键盘模块的设计 . 12 4.3. 系统电路的仿真 . 12 5. 系统程序的设计 . 14 5.1. LCD1602 的程序设计 15 5.2. DS1302 程序设计 16 5.3.