(2015届)毕业设计题目:基于单片机的简易电子琴设计姓名:林初丰专业:电气工程及其自动化班级:电气N111学号:201145679226指导教师:程海玉导师职称:讲师嘉兴学院南湖学院教学事务管理中心年月日诚信声明我声明,所呈交的设计是本人在老师指导下进行的研究工作及取得的研究成果。据我查证,除了文中特别加以标注和致谢的地方外,设计中不包含其他人已经发表或撰写过的研究成果,也不包含为获得嘉兴学院南湖学院或其他教育机构的学位或证书而使用过的材料。我承诺,设计中的所有内容均真实、可信。设计作者签名:签名日期:年月日授权声明学校有权保留送交设计的原件,允许设计被查阅和借阅,学校可以公布设计的全部或部分内容,可以影印、缩印或其他复制手段保存设计,学校必须严格按照授权对设计进行处理,不得超越授权对设计进行任意处置。设计作者签名:签名日期:年月日I基于单片机的简易电子琴设计摘要本设计核心内容是关于基于AT89C51单片机的简易电子琴设计。系统由单片机AT89C51、独立键盘模块、功率放大模块、扬声器、数码管所组成。其软件部分主要有主程序模块、播放模块、按键模块、显示程序。本设计首先要对AT89C51单片机有一定的认识,继而按照电子琴功能制作出硬件电路并编写源程序,最后对其进行仿真调试。系统带有10个独立按键,其中8个独立按键分别代表8个音符,8个按键每个按键在数码管也会对应一个字符来指示用户所按下的按键,还有两个为功能按键按键。同时本系统还带有一个存储播放音乐的功能,使用者可以通过按下功能按键来播放存储的歌曲,系统会把用户程序内存储的音符进行播放,在自动播放的过程中如果按下另外一个功能按键则中断播放歌曲。本次设计的主要优点有硬件电路结构简单易实现,电子琴所需功能基本具备,系统稳定可靠.关键词:at89c51,电子琴,弹奏IIDesignofasimpleelectronicorganbasedonsinglechipmicrocomputerABSTRACTThisdesignisthecorecontentofsimpleelectronicorganbasedonAT89C51isdesigned.SystembysinglechipmicrocomputerAT89C51,independentkeyboardmodule,poweramplificationmodule,speaker,digitaltube.Itssoftwarepartmainlyhasthemainprogrammodule,themodule,keysmodule,displayapplications.ThisdesignmustfirsthaveacertainunderstandingofAT89C51,thenaccordingtotheelectronicorganfunctionsproducehardwarecircuitandtheprogramsarethesource,finallycarriesonthesimulationdebugging.Systemwith10independentkey,includingeightindependentkeysrepresenttheeightnotes,eachkeyeightbuttonsinthedigitaltubewillalsocorrespondstoacharactertoindicatetheuserpressthebutton,andtwoforthekeybutton.Simultaneouslythissystemalsocomeswithastorageplaythefunctionofmusic,theusercanpressthefunctionbuttontogoodsongs,storagesystemwillstoretheuserprograminthenotestoplay,intheprocessofautomaticplaybackifpressbuttonsonanotherfunctionistheinterruptplaysongs.Thedesignofthemainadvantageofthehardwarecircuitstructureissimpletoimplement,electronicorganfunctionbasically,thesystemisstableandreliable.Keywords:At89c51,electronicorgan,playing,recording.III目录1绪论.............................................................................................................................................................11.1单片机背景.......................................................................................................................................11.2单片机电子琴应用...........................................................................................................................22电子琴方案设计.........................................................................................................................................32.1设计要求..........................................................................................................................................32.2电子琴设计方案..............................................................................................................................33硬件设计.....................................................................................................................................................53.1单片机..............................................................................................................................................53.1.1AT89C51简介.......................................................................................................................53.1.2主要的功能特性...................................................................................................................53.1.3I/O端口介绍.........................................................................................................................53.1.4定时/计数器的应用..............................................................................................................63.2按键设计..........................................................................................................................................73.3LED数码管......................................................................................................................................83.3.1数码管的驱动方式...............................................................................................................83.3.2数码管的选择.......................................................................................................................93.4扬声器.............................................................................................................................................104软件设计...................................................................................................................................................114.1程序流程图.....................................................................................................................................114.2程序语言的选择.............................................................................................................................125仿真调试...................................................................................................................................................135.1Proteus简介............................................................................