本科毕业设计说明书
(
题 目:多 功 能 数 字 时 钟
二 〇 一〇 年 六 月
设 计
的
摘要
数字时钟在日常生活中最常见,应用也最广泛。本次数字时钟电路根据设计要求采用AT89C51单片机作为控制核心,采用DS1302来实现时、分、秒24小时计时,采用DS18B20来实现温度的测量,采用LED实现显示,采用蜂鸣器实现报警功能。文章的核心主要是硬件设计和软件编程两个大的方面。硬件电路设计主要包括中央处理单元电路、时钟电路、温度测量电路、键盘扫描电路、报警电路。软件用汇编语言及C语言来实现,主要包括主程序、时间设置子程序、温度测量子程序、键盘扫描子程序、报警电路子程序等软件模块。电路实现了显示时间、调整时间、测量并显示温度、报警、闹钟定时等功能,达到了设计的要求和目的。并在伟福软件上进行了仿真和调试。
关键词: 数字时钟;AT89C51;DS1302;DS18B20;LED;蜂鸣器
Abstract
Digital clock in their daily lives the most common applications and the most widely. The digital clock circuit according to design requirements using AT89C51 microcontroller as the control, using DS1302 to achieve the hours, minutes, seconds, 24 hours time, using DS18B20 to achieve the temperature measurement, using LED to achieve display, using a buzzer to achieve alarm function. The core of the article is mainly hardware design and software programming. Hardware design includes a central processing unit circuit, clock circuit, temperature measurement circuit, the keyboard scanning circuit, alarm circuit. Using assembly language and C language for software design, including the main program and time setting subroutine, temperature measurement subroutine, the keyboard scan subroutine, subroutines and other software modules alarm circuit. Circuit completed show time, adjustment time, measuring and displaying temperature, alarms, alarm clock timer functions. I complete the design requirements and objectives. And I simulate and test them in Wave software.
Keywords: digital clock; AT89C51; DS1302; DS18B20; LED; buzzer
目录
摘要................................................................ 2 目录................................................................ 4 第一章 绪论......................................................... 1
1.1 课题研究背景 ................................................ 1 1.2 课题研究意义 ................................................ 2 1.3 本文的主要内容 .............................................. 2 第二章 方案论证及设计............................................... 4
2.1 总体方向的选择 .............................................. 4
2.1.1 基础FPGA的多功能数字时钟的设计........................ 4 2.1.2 基于VHDL的多功能数字时钟的设计........................ 4 2.1.3 基于 单片机的多功能数字时钟的设计...................... 4 2.2 控制芯片及数字时钟芯片的选择 ............................... 5
2.2.1 AT89S51及DS12887芯片 ................................ 5 2.2.2 AT89C51及DS1302芯片 ................................. 5 2.3 温度测量芯片的选择 .......................................... 7 2.4 显示部分的选择 .............................................. 8
2.4.1 静态显示............................................... 8 2.4.2 动态显示............................................... 8 2.5 方案小结 .................................................... 9 第三章 核心芯片简介................................................ 10
3.1 AT89C51简介............................................... 10 3.2 DS1302简介................................................ 14
3.2.1 DS1302引脚功能与内部结构 ........................... 14 3.2.2 DS1302的控制字 ..................................... 15 3.2.3 DS1302的复位引脚 ................................... 16 3.2.4 DS1302的数据输入输出 ................................ 16 3.2.5 DS1302的寄存器 ...................................... 16 3.3 DS18B20简介............................................... 18
3.3.1 DS18B20特性 ......................................... 18 3.3.2 DS18B20引脚排列 ..................................... 19 3.3.3 详细说明.............................................. 20
第四章 系统硬件设计................................................ 25
4.1 硬件主要电路设计 ........................................... 25 4.2 时钟电路的设计 ............................................. 26 4.3 温度测量电路的设计 ......................................... 27 4.4 键盘扫描电路的设计 ......................................... 28 4.5 显示电路的设计 ............................................. 29 4.6 报警电路设计 ............................................... 30 4.7 AT89C51复位电路,时钟电路.................................. 31 4.8 单片机系统电路图 ........................................... 32
第五章 系统软件设计................................................ 33 结论............................................................... 34 参考文献........................................................... 35 谢辞............................................................... 36