I基于单片机的电子琴设计摘要读书、看电影、听音乐,都是最常见的丰富内心世界的良剂。听音乐,作为陶冶情操、提升境界最便捷的方式,正受到越来越多人们的欢迎。音乐可以很轻松的融入各种场合,给人们带来很轻松的氛围,只有真正的接触它,才可以真正的感受到它的魅力。本次设计正是基于这样的一种考虑,将实现一种简易电子琴的制作,考虑到市面上的电子琴因型号各异,款式各异,所以在价格方面也会有很大的差别,而这次设计将结合电子琴的功能性以及实用性将成本降至最小化来进行制作。本次设计主要用到的芯片是STC89C51,系统里包含了几大核心模块主要有按键模块、扬声器模块、数码管模块等。此次设计主要能实现的功能是:键盘上有12个按键,上面8个分别代表不同的音符键,当触发到某一个按键时扬声器会发出对应的音符,这样只要有完整的乐谱,就可以弹奏出非常美妙的音乐。此外剩下的4个按键是功能键。此次系统的设计不仅涉及到硬件方面还涉及到软件方面,所以得从两方面展开巩固系统。关键词:STC89C51单片机电子琴键盘DesignofelectronicorganbasedonsinglechipIImicrocomputerAbstractReading,movies,listeningtomusicareagooddoseofthemostcommonrichinnerworld.Tolistentomusic,asthemoldsentiment,enhancetherealmofthemostconvenientway,isbeingmoreandmorepeople'swelcome。Musiccanbeveryeasytointegrateintovariousoccasions,togivepeopleaveryrelaxedatmosphere,onlytherealcontactwithit,youcanreallyfeelitscharm.Thedesignisbasedonsuchaconsideration,theproductionofasimpleelectronicpiano,Takingintoaccounttheelectronicorganonthemarketduetodifferentmodels,differentstyles,sotherewillbealotofdifferenceintermsofprice,Andthisdesignwillcombinethefunctionofelectronicorganandpracticalitytominimizethecostofproduction.ThedesignofthemainuseofthechipisSTC89C51,Systemcontainsseveralmajorcoremodulesarekeymodules,speakermodule,digitalcontrolmoduleandsoon.Thisdesigncanachievethemainfunctionis:Thereare12keysonthekeyboard,thetop8respectivelyrepresentdifferentnotes,whenthetriggertoacertainbuttonwhenthespeakerwillsendthecorrespondingnote,Soaslongasthereisacompletescore,youcanplayaverywonderfulmusic.Inadditiontotheremaining4buttons,whichhavesomefunactions.Thesystemisnotonlyinvolvedinthedesignofhardware,butalsorelatedtothesoftware,sowehavetostartfromtwoaspectsoftheconsolidationofthesystem.Keywords:STC89C51electronicorgankeyboard目录摘要.........................................................IAbstract......................................................II目录........................................................IIIIII1绪论................................................................................................................11.1电子琴设计的背景及意义.........................................................................12硬件设计及说明............................................................................................32.1系统组成及总体框图........................................32.2元件简介..................................................32.3各功能模块原理图..........................................83软件设计..................................................113.1音乐方面知识............................................113.2用单片机产生音频脉冲....................................113.3系统总体功能流程图......................................114系统调试....................................................................................................134.1硬件调试................................................134.2软件调试..................................