2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > 单片机at89c51数字钟c语言 基于AT89C51单片机的数字钟设计

单片机at89c51数字钟c语言 基于AT89C51单片机的数字钟设计

时间:2021-04-29 02:20:32

相关推荐

单片机at89c51数字钟c语言 基于AT89C51单片机的数字钟设计

基于AT89C51单片机的数字钟设计

摘要

当前温度和时间的现场采集和显示系统已有广泛的使用,所以电子钟的应用范围非常的广,比如家里,公共场所还有一些特定的地方,如在电力,工业,农业等领域也有很多应用。

本次设计的数字钟主要实现可以正确的显示时间/日历,以及对环境温度的测量,并带有按键调整时间/日历,和温度报警和定时闹钟功能。

本次的毕业设计是以采用AT89C51单片机为核心,通过使用时钟芯片DS1302来实现时钟和日历的功能,同时利用DS18B20数字温度传感器来测量环境温度,最后通过LCD1602液晶显示器来把这些数据显示出来,同时利用按键来实现闹钟

和数据的修改的功能以及温度的报警。这样的设计理念带来了许多好处,电路设计简单化,抗干扰能力强,时间和温度的精度高,数据清晰度高,而且提供了良好的人机界面。

实践证明该系统的可靠性高,操作简单,除了可以应用在一般的生活和工作中,同时也可在电力﹑化工等领域使用。

关键字:AT89C51;DS1302;DS18B20;LCD1602;按键控制;

ABSTRACT

The current temperature and time of site acquisition and display systems had been widely used, so the electronic clock of the wide range of applications, like household, public places there are some specific places, such as in power, industry, agriculture and other fields have many applications .

The main realization of the designed digital clock display correctly time / calendar, and the environmental temperature measurement, and with a key to adjust the time / calendar, alarm and temperature alarm and timer function.

The graduation project is using AT89C51 microcontroller as the core, by using the clock chip DS1302 to achieve the clock and calendar functions, while using DS18B20 digital temperature sensor to measure ambient temperature, and finally through the LCD1602 LCD monitor to bring the data displayed ,at the same time using keys is achieving the alarm clock and data modification function and temperature alarm. This design has brought many benefits, simplified circuit design, anti-interference ability, time and temperature with high accuracy, high resolution data, but also provide a good user interface.

The system proved reliable, simple operation, which can be used in the general life and work, but also in the areas of electrical, chemical use.

Key words : AT89C51;DS1302;DS18B20;LCD1602;Key Control;

目录

摘要................................................................1

ABSTRACT............................................................2

第一章引言.........................................................5

1.1数字钟研究的背景和意义......................................5

1.2数字钟的功能................................................5

第二章数字钟的设计方案.............................................6

2.1 单片机设计方案..............................................6

第三章 基于单片机的数字钟的硬件设计.................................7

3.1 核心部件的介绍..............................................7

3.1.1 AT89C51单片机介绍.....................................7

3.1.2 DS1302时钟芯片介绍....................................8

3.1.2.1 DS1302时钟芯片简介............................8

3.1.2.2 DS1302时钟芯片引脚说明........................8

3.1.2.3 DS1302片内寄存器..............................9

3.1.2.4 DS1302控制字和时序读写说明...................11

3.1.3 DS18B20温度传感器介绍................................12

3.1.3.1 DS18B20温度传感器简介和引脚说明..............12

3.1.3.2 DS18B20温度传感器内部结构....................13

3.1.3.3 DS18B20数据处理..............................14

3.1.3.4 DS18B20控制命令和读写时序...................14

3.1.4 LCD1602液晶显示模块介绍..............................15

3.1.4.1 LCD1602液晶显示模块简介......................15

3.1.4.2 LCD1602基本参数和引脚说明....................16

3.1.4.3 LCD1602指令说明和读写时序....................18

3.1.4.4 LCD1602RAM地址映射和以及标准库表.............20

第四章 数字钟硬件电路设计..........................................21

4.1 时钟电路设计..............................................21

4.2 温度采集电路设计.........................................

4.3 数据显示电路设计.........................................

4.4 按键设置电路设计.........................................

4.5 闹钟和报警电路设计......................................

第五章 数字钟的软件设计..........................................

5.1 主程序设计......................................

5.2 子程序设计......................................

5.2.1 按键扫描子程序......................................

5.2.2 时钟日历子程序......................................

5.2.3 温度数据采集子程序.................................

5.2.4 显示子程序..................................

第六章 软件调试.................................................

6.1 时钟日历程序调试

6.2 温度数据采集程序调试

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。