基于51单片机的花样流水灯设计.doc
摘要
计算机技术的飞速发展和提高,把我们带入了崭新的时代,现在,计算机的应用已经深入到千家万户。单片微型计算机是制作在一块集成电路芯片上的计算机,简称单片机。单片机在现在社会有着广泛的应用,小到人们的日常电子用品,大到航天飞机、宇宙飞船,上面都有单片机的广泛应用。单片机具有体积小、功能强大、低功耗、应用广泛等特点。以AT公司的芯片AT89C51单片机来实现流水灯的设计。本系统由单片机控制,I/O口接LED的负极,而LED的正极则直接与5V电源相连。通过I/O口输出的低电平点亮LED灯。因此可以通过控制单片机的I/O口的电平高低以达到控制LED,从而实现不同花样的流水灯的目的。
关键词:LED,单片机,高低电平变化
ABSTRACT
Therapiddevelopmentofcomputertechnologyandimproving,bringustothenewera,now,theapplicationofcomputerhasbeendeepintothethousands.Singlechipmicrocomputerismadeonanintegratedcircuitchipcomputer,hereinafterreferredtoassinglechipmicrocomputer.SCMhasbeenwidelyusedinthepresentsociety,smalltoPeoplesDailyelectronicproducts,bigtoaerospaceaircraft,spacecraft,abovehasthewideapplicationofsingle-chipmicrocomputer.SCMhassmallvolume,powerfulfunction,lowpowerconsumption,wideapplication,etc.ATthecompanyschipAT89C51single-chipmicrocomputertorealizethewaterlampdesign.Thissystemcontrolledbysinglechipmicrocomputer,I/OportsconnecttheLEDthecathode,andLEDtheanodeisdirectlyconnectedto5Vpowersupply.ThroughtheI/Oportoutputlowlevellightleds.SoyoucansinglechipmicrocomputercontrolthroughtheI/OportstocontrolLED,thelevelofhighandlowsoastorealizethepurposeofthedifferentpatternofflowingwaterlight.
Keywords:LED,MCU,HighandLowoutputleve
目录
TOC\o1-3\h\z\u第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.4LED灯电路 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.5LED灯输出控制模块 18
4.4程序调试仿真 19
4.4.1仿真平台介绍 19
4.4.2仿真测试 19
第5章硬件调试 21
5.1硬件设计 21
5.2硬件调试 21
5.2.1下载功能调试 21
5.