您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > AT89s52单片机电子琴
河南理工大学本科课程设计报告1河河南南理理工工大大学学《单片机应用与仿真训练》设计报告基于单片机的电子琴设计姓名:学号:专业班级:指导老师:所在学院:电气工程与自动化学院2011年月日河南理工大学本科课程设计报告2摘要本设计是基于AT89S52单片机来对电子琴的主体部分进行设计,用以实现电子琴的基本功能。本设计主要运用了AT89S52单片机的定时、中断功能,利用定时器可发出不同频率的脉冲,不同频率的脉冲经蜂鸣器后,就会发出不同音调。定时器按设计的定时参数产生中断,这一次中断发出脉冲低电平,下一次取反发出脉冲高电平,由于定时参数不同,就发出不同频率的脉冲。本制作中巧妙地利用了单片机的定时器,让定时器中断一次就改变蜂鸣器的状态一次,即形成矩形方波频率信号,每个频率信号对应不同的音阶,再分别由对应的按键控制,当相应的按键按下后便可产生相应的音调。本设计实现的功能是利用蜂鸣器作为发声部件,两个数码管作为显示部件,设置11个按键,实现高音、中音、低音的1、2、3、4、5、6、7的发音,并存储一首歌的内容,可以实现自动播放。关键词:AT89S52单片机、按键、蜂鸣器、电子琴、显示AbstractThisdesignwasmainlybasedonelectronicAT89S52SCMdesign,themainparttothebasicfunctionoftheorgan.ThisdesignismainlyusedforthetimingandAT89S52SCMinterruptfunction,useadifferentfrequencytimercanpulsefrequency,differentpulseamplificationfilteringthroughspeakers,afterdrivingcircuitwillbeissuedadifferenttone.Accordingtothedesignofthetimerinterruption,thetimingparametersgeneratedalowlevel,apulseinterruptiontakethenexttimeapulsetimingparameters,duetothehighlevelisdifferentindifferentfrequency,pulse.Theingenioususeofsingle-chiptimer,letthetimerinterrupttimetochangethestateofspeakers,formingarectangularpulsefrequencysignal,eachfrequencysignalcorrespondingdifferentsyllable,thenrespectivelybythecorrespondingkeycontrol,whenthecorrespondingkeypressandcanproducethecorrespondingtones.Thefunctionoftherealizationofthedesignistouseasavoiceparts,buzzertwodigitaltubeasdisplayparts,setup11key,realizehigh,alto,bassof1,2,3,4,5,6,7pronunciation,andstorage,thecontentsofthesongcanberealizedautomaticplayback.Keywords:AT89S52SCM,buttons,speaker,keyboard,display河南理工大学本科课程设计报告3摘要..................................................................................................................................................21概述...............................................................................................................................................41.1设计背景.............................................................................................................................41.2系统开发的目标................................................................................................................41.3本系统的主要内容.............................................................................................................52系统总体方案及硬件设计............................................................................................................52.1系统组成及总体框图.........................................................................................................52.2主要元件简介.....................................................................................................................52.2.1AT89S52简介..........................................................................................................62.2.2蜂鸣器.....................................................................................................................92.3键盘设计..........................................................................................................................102.3.1键盘的结构与工作原理......................................................................................102.3.2本设计键盘所实现的功能...................................................................................112.4显示电路...........................................................................................................................122.5复位电路...........................................................................................................................132.6时钟电路...........................................................................................................................133软件设计......................................................................................................................................153.1系统整体程序处理流程图...............................................................................................153.2音乐播放...........................................................................................................................163.3放歌设计...........................................................................................................................174元件清单......................................................................................................................................185课程设计体会..............................................................................................................................19参考文献.........................................................................................................................................20附录1源程序代码.........................................................................................................................21附录2Proteus软件仿真图.........................................................................................................29河南理工大学本科课程设计报告41概述1.1设计背景电子琴是现代音乐中不可缺少的乐器,它是现代科技和音乐的结合。单片有具有强大的控制功能和灵活的编程实现能力,所以本设计的主要内容就是基于单片机的电子琴设计。以AT89S52单片机为核心控制元件,与键盘、扬声器、蜂鸣发声器等组成核心主控模块。本文主要对基于单片机的电子琴设计进行了分析,并介绍了基于单片机电子琴的硬件组成和软件系统,并且本文分别从原理图,主要芯片,各模块原理及各模块程序来详细阐述。一首音乐是许多不同的音阶组成
本文标题:AT89s52单片机电子琴
链接地址:https://www.777doc.com/doc-4370432 .html