内江师范学院本科毕业设计i目录1引言...........................................................................................................................................12硬件设计...................................................................................................................................22.1硬件电路的设计框图....................................................................................................22.2硬件电路设计模块的选定............................................................................................22.2.1中心模块.....................................................................................................................22.2.2播放模块.....................................................................................................................32.2.3显示模块.....................................................................................................................42.2.4电子琴模块.................................................................................................................42.3各硬件电路的具体设计................................................................................................52.3.1AT89S52控制模块的设计.........................................................................................52.3.2按键模块的设计.........................................................................................................62.3.3扬声器播放模块的设计.............................................................................................72.3.4LCD显示电路的设计................................................................................................72.3.5彩灯伴奏电路的设计.................................................................................................83软件设计...................................................................................................................................93.1单片机发声的基本原理................................................................................................93.2设计的相关音乐说明................................................................................................93.3切换原理......................................................................................................................103.4音乐播放器软件程序设计..........................................................................................103.4.1按键扫描子程序设计...............................................................................................103.4.21ms延时程序设计...................................................................................................143.4.3LCD显示子程序设计..............................................................................................153.4.4函数初始化子程序设计...........................................................................................163.4.5系统主程序设计.......................................................................................................174结论.........................................................................................................................................19参考文献....................................................................................................................................20内江师范学院本科毕业设计ii附录一硬件原理图..................................................................................................................21附录二软件主程序..................................................................................................................22致谢............................................................................................................................................32内江师范学院本科毕业设计iii摘要目前流行的MP3播放器的音质已相当好,但略感遗憾的是除了选择歌曲和显示歌名外,绝大部分播放器没有诸如随意弹奏乐曲、乐曲节奏跳动等功能。而随着人们生活水平的不断提高,单片机控制无疑是人们追求的目标之一。要为现代人工作、生活提供更好的更方便的服务就需要从单片机技术着手,一切向着数字化控制、智能化控制方向发展。本设计是采用单片机为核心设计的数字音乐播放器。本设计在实现音乐的播放及歌曲名显示等基本功能的基础上进行了扩展,添加了彩灯伴奏、按键弹奏、显示音乐节拍等功能。本论文给出了系统方案的建立、硬件电路的详细设计及软件的程序实现。并通过软硬件的联立调试,验证了设计方案的可行性。关键词:多功能;MP3音乐播放器;单片机;按键弹奏内江师范学院本科毕业设计ivAbstractThecurrentpopularMP3playersoundhasbeenquitegood,butfeelregretfulslightlyisinadditiontothechoiceofsongsanddisplaythesongname,mostplayerswithoutsuchasrandomplaymusicrhythm,musicandotherfunctions.Butaspeoplelivingstandardriseceaselessly,SCMcontrolisoneofthegoalsthatpeoplepursue.Forthemodernlifeofwork,toprovidebetterandmoreconvenientserviceneedsfromproceedtowardtheSCMtechnology,alldigitalcontrol,intelligentcontroldirection.Thisdesignistheuseofsingle-chipmicrocomputerasthecoredesignofthedigitalmusicplayer.Thedesignintheimplementationofmusicplayingandthesongnamedisplayandotherbasicfunctionsbasedontheexpansion,addinglightsaccompaniment,playbutton,displaythebeatofthemusicandotherfunctions.Thispapergivesasystemscheme,hardwareestablishmentdetailedcircuitdesignandsoftwareprogram.Andthroughthesoftwareandhardwareofsimultaneousdebugging,verifythefeasibilityofthedesignscheme.Keywords:multifunction;MP3musicplayer;singlechipmicrocomputer;playbutton内江师范学院本科毕业设计11引言二十世纪九十年代以来,计算机、信息、电子、控制、通信等技术得到迅速发展,促使了社会生产力的提高,也使人们的生产方式和生活方式产生了日新月异的变化。随着人们生活水平的提高及对音乐的喜爱,对音乐播放器的品质,功能,品种等提出了越来越多的要求,表现在对控制系统性能、可靠性等要求越来越高。而品质的提高,功能的更新,可靠性的增强,