基于51单片机的花样流水灯设计_毕业论文 下载本文

内容发布更新时间 : 2024/11/16 15:59:47星期一 下面是文章的全部内容请认真阅读。

摘 要

摘 要

计算机技术的飞速发展和提高,把我们带入了崭新的时代,现在,计算机的应用已经深入到千家万户。单片微型计算机是制作在一块集成电路芯片上的计算机,简称单片机。单片机在现在社会有着广泛的应用,小到人们的日常电子用品,大到航天飞机、宇宙飞船,上面都有单片机的广泛应用。单片机具有体积小、功能强大、低功耗、应用广泛等特点。以AT公司的芯片 AT89C51 单片机来实现流水灯的设计。本系统由单片机控制,I/O口接LED的负极,而LED的正极则直接与5V电源相连。通过I/O口输出的低电平点亮LED灯。因此可以通过控制单片机的I/O口的电平高低以达到控制LED,从而实现不同花样的流水灯的目的。

关键词:LED,单片机,高低电平变化

I

ABSTRACT

ABSTRACT

The rapid development of computer technology and improving, bring us to the new era, now, the application of computer has been deep into the thousands. Single chip microcomputer is made on an integrated circuit chip computer, hereinafter referred to as single chip microcomputer. SCM has been widely used in the present society, small to People's Daily electronic products, big to aerospace aircraft, spacecraft, above has the wide application of single-chip microcomputer. SCM has small volume, powerful function, low power consumption, wide application, etc. AT the company's chip AT89C51 single-chip microcomputer to realize the water lamp design. This system controlled by single chip microcomputer, I/O ports connect the LED the cathode, and LED the anode is directly connected to 5V power supply. Through the I/O port output low level light leds. So you can single chip microcomputer control through the I/O ports to control LED, the level of high and low so as to realize the purpose of the different pattern of flowing water light.

Key words: LED , MCU ,High and Low output leve

II

目录

目 录

第1章 引言 .................................................................................................................. 1 1.1 研究背景及意义 ....................................................................................................... 1 1.2 国内外研究现状以及本系统的重点问题 ............................................................... 1 1.3 本文章节安排 ........................................................................................................... 2 第2章 系统设计方案论证 .......................................................................................... 3 2.1 控制器模块方案论证 ............................................................................................... 3 2.2 键盘模块方案 ........................................................................................................... 4 2.3 电源模块方案 ........................................................................................................... 4 第3章 系统硬件设计方案 .......................................................................................... 5 3.1 系统设计框图 ........................................................................................................... 5 3.2 硬件电路设计 ........................................................................................................... 5 3.2.1 电源电路 ................................................................................................................ 5 3.2.2 单片机89C52最小系统 ....................................................................................... 6 3.2.3 按键电路 .............................................................................................................. 13 3.3.4 LED灯电路 .......................................................................................................... 13 第4章 程序设计及软件仿真 .................................................................................... 15 4.1 软件设计框图 ......................................................................................................... 15 4.2 软件开发平台选择 ................................................................................................. 15 4.3 软件系统功能模块 ................................................................................................. 16 4.3.1 初始化模块 .......................................................................................................... 16 4.3.2 延时函数 .............................................................................................................. 17 4.3.3 定时器控制模块 .................................................................................................. 17 4.3.4 键盘扫描模式 ...................................................................................................... 17 4.3.5 LED灯输出控制模块 .......................................................................................... 18 4.4 程序调试仿真 ......................................................................................................... 19 4.4.1 仿真平台介绍 ...................................................................................................... 19 4.4.2 仿真测试 .............................................................................................................. 19 第5章 硬件调试 ........................................................................................................ 21

III