资源描述:
《基于单片机的音乐发生器设计设计》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、郑州航空工业管理学院毕业论文(设计)2013届电气工程及其自动化专业1106971班级题目基于51单片机的音乐发生器设计姓名学号指导教师职称二О一三年五月十六日内容提要本文是应用MCS-51单片机原理和控制理论技术设计音乐发生器的硬件电路,并利用C语言进行软件开发和程序设计。通过控制单片机内部的定时器产生不同频率的方波,驱动喇叭发出不同音调的音乐,再利用延迟控制发音时间的长短。把乐谱转化成相应的定时常数,从而达到从发音设备中演奏出悦耳动听的音乐的效果。该音乐盒主要由按键电路、复位电路、时钟电路以及蜂
2、鸣器组成。使用两个按键控制音乐盒,一个用来切换歌曲,另一个用来切换8路LED的变化花样,本音乐盒共有两首歌曲,花样灯花样共计3种。播放歌曲时,蜂鸣器发出某个音调,与之对应的LED亮起。本设计利用KEIL编程软件对音乐盒源程序进行编程并调试,配合PROTEUS仿真软件对硬件进行仿真调试,节约了设计时间。本系统采用C语言进行软件设计。正文中首先简单描述系统硬件工作原理,且附以系统硬件设计框图,论述了本次毕业设计所应用的各硬件接口技术和各个接口模块的功能及工作过程。其次阐述了程序的流程和实现过程。本文撰写
3、的主导思想是软、硬件相结合,以硬件为基础,来进行各功能模块的编写。关键词单片机;音乐;C语言;STC89C51;KEIL;PROTEUSAbstractInthispaper,ThemusicgeneratoranditshardwarecircuitisdesignedbyMCS-51single-chipmicrocomputerprincipleandcontroltheory,andtheSoftwaredevelopmentandprogrammingarebasedonClanguage
4、programming.AccordingtocontroltheMCUinternaltimertoproducedifferentfrequencySquarewavetodrivethehornsoundsofdifferenttonesofmusic,thenusethedelaytocontrolthelengthoftime.ThemusicTransformationedintothetimingconstantscorrespondingsothatthesoundequipment
5、canplayMelodiousmusic.Themusicboxismainlycomposedofkeypadcircuit,resetcircuit,clockcircuitandabuzzer.Twobuttonsareusedtocontrolthemusicbox,onetoswitchsongs,anotherisusedtoswitchthe8LEDpattern,themusicboxhastwosongs,atotalof3kindsofpatternlightpattern.W
6、hilethemusicisplaying,thebuzzersoundedatone,andthecorrespondingLEDlightsup.ThedesignofprogrammingthemusicboxanddebugsourcecodeusingKEILprogrammingsoftware,andtosavethedesigntimethePROTEUSsimulationsoftwareisusedtosimulatethehardwaredebugging.Thesystemu
7、sesClanguageforsoftwaredesign.Firstly,inthetextdescribestheworkingprincipleofthesystemhardware,andattachedtothesystemblockdiagramofhardwaredesigntodiscussethefunctionandworkingprocessofthegraduationdesignandtheapplicationofthehardwareinterfacetechnolog
8、yandtheinterfacemodule.Secondly,expoundtheproceduresandprocessestoachieveprocess.Themainideaofthiswritingisacombinationofsoftwareandhardware,onthebaseofhardware,writetoeachfunctionmodule.KeywordsSinglechip;music;Clanguage;STC89C51;KEIL;