基于c语言的时钟日历和温度传感器设计大学毕业论文(设计).doc
文本预览下载声明
摘 要
本设计应用AT89S52芯片作为核心,采用C语言进行编程,实现以下功能:小时、分、秒、年、月、日、星期的显示和实时温度检测。该设计的电子时钟系统由时钟电路、LCD显示电路、按键调整电路和温度检测电路四部分组成。使用时钟芯片DS1302完成时钟日期的功能,以LCD1602为显示器,同时利用温度传感器DS18B20测量周围环境温度,并且可以依靠按键随时对日期时间进行调整。我们共设计四个按键,一个模式键,也就是我们用来选定被修改的数字的,两个调整键,一个“加”键和一个“减”键,当按下模式键,选定要调整的数字的时候,“加”、“减”可以帮我们调到所需的状态,还有一个复位键,显示精度为1秒。设计还提供三位实时温度检测并显示,其显示精度为0.1℃。关键词:AT89S52;时钟日历芯片DS1302;温度传感器DS18B20
Abstract
The design is applied with AT89S52 chip as the core, use C program language, to achieve the following functions: hours, minutes, seconds, and the year, month, date display, real-time temperature sensing. The design of electronic clock contains electronic clock circuit, LCD display circuit, buttons and temperature detection circuit adjustment circuit four parts. Use the clock date clock chip DS1302 completed features to display by LCD1602, while using the temperature sensor DS18B20 measuring ambient temperature, and rely on keys to adjust at, date, time at any time. We have designed four buttons, one mode key, this key help we chose the number that are need to modify, and two adjustment key, one plus key, one minus key. After press the mode button, select the time to be adjusted, add or sub the number to the desired state, there is a certain key, press the OK button to enter the normal clock mode after adjusted. This design provides both temperature sensing and display real-time.
Key words:AT89S52;Clendar Clock Chip DS1302;Temperature sensor DS18B20
目 录
第1章 概述 1
1.1 单片机的定义和特点 1
1.2 单片机的发展现状和发展趋势 2
1.3 编程语言的选择 3
第2章 基于单片机的电子时钟硬件设计 5
2.1 MCU的选择与AT89S52简介 5
2.2 时钟电路的设计 8
2.3 环境温度采集电路的设计 12
2.4 显示电路的设计 16
2.5 按键电路的设计 17
2.6 复位电路的设计 18
2.7 本章小结 19
第3章 基于单片机的电子时钟软件设计 20
3.1 主程序设计 20
3.2 实时时钟日历子程序设计 20
3.3 本章小结 23
第4章 系统调试 24
4.1 单片机基础电路与显示电路的调试 24
4.2 DS1302电路的调试 24
4.3 环境温度采集电路与按键电路的调试 25
4.4 硬件调试结果 25
4.5 本章小结 26
结论 27
参考文献 28
致 谢 30
附录1 总设计原理图、PCB图 31
附录2 程序 32
第1章 概述
目前单片机渗透到了我们生活的各个领域,几乎很难找到哪个领域没有单片机的踪迹。导弹的导航装置,飞机上各种仪表的控制,计算机的网络通讯与数据传输,工业自动化过程的实时控制和数据处理,广泛使用的各种智能IC卡,民用豪华轿车的安全保障系统,录像机、摄像机、全自动洗衣机
显示全部