毕业设计 中文题目基于51单片机的多功能电子钟设计 英文题目 Design of Multi-function Clock Based on 51 MCU 系别:电子与电气工程系 年级专业:07级电气工程及其自动化 姓名: 学号:20070621236 指导教师: 职称:讲师 2011年 5月 24日 基于51单片机的多功能电子钟设计 【摘要】数字电子时钟是人们日常生活中不可或缺的必需品。本文以STC89C52为核心控制芯片,DS12887为时钟芯片,DS18B20为温度传感器,通过液晶显示器LCD1602实时显示时间及温度,通过按键设置年月日和星期以及定时闹钟,定时闹钟时间到自动发出警报。本设计的+5V电源采用LM1117电压转换元件,将电源适配器转换得到的12V电压直接变成5V电压供系统使用。程序的下载则是通过普中科技公司自制的PZ-ISP软件完成。经过测试,系统可以正常完成预定的功能。 【关键词】电子时钟;单片机;DS12887;DS18B20; Design of Multi-function Clock Based on 51 MCU 【Abstract】Digital electronic clock is an integral, necessary part of daily this paper, STC89C52 chip is used as the core control chip, DS12887chip is used as the clock chip, DS18B20 chip is used as the temperature sensor and LCD1602 was used to diaplay time and temperature。 You can set year, month and time alarm clock through the four the real time reach to the time clock,the system will warn automatically. The +5V power of the system is supplied by LM1117 voltage conversion device. The 12V voltage get from power adapter was transformed directly into 5V voltage for the system. The download of the process is plished through the PZ-ISP software made by Puzhong pany. After testing, the system plete the scheduled function normally. 【key words】electronic clock;MCU;DS12887;DS18B20 目录 第一章绪论 1 1 1 第二章总体方案 4 系统的设计思路 4 系统硬件描述 4 系统软件描述 4 设计流程和预期成果 5 第三章硬件设计 6 硬件芯片介绍 6 单片机STC89C52 6 实时时钟芯片DS12887 10 温度传感器DS18B20 14 液晶显示屏LCD1602 18 系统硬件架构 20 单片机最小系统 21 时钟模块 23 温度传感器模块 24 液晶显示模块 25 按键模块 26 蜂鸣器报警模块 27 第四章软件设计 29 软件设计总体说明 29 主程序软件实现 29 29 30 DS18B20模块软件实现 32 DS18B20模块子程序流程图 32 DS18B20模块子程序代码 32 LCD1602模块软件实现 35 LCD1602液晶显示模块子程序流程图 35 LCD1602液晶显示模块子程序代码 36 DS12887模块软件实现 39 DS12887模块子程序流程图 39 DS12887模块子程序代码 40 报警模块软件实现 51 报警模块子程序流程图 51