资源描述:
《电子音乐盒的单片机设计.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、单片机课程设计论文题目FSY电子音乐盒的单片机设计学院通信与电子工程学院专业班级电子083学生姓名指导教师王发智2011年12月11日摘要为了实现单片机控制音乐播放,此次毕业设计做出了尝试,即电子音乐盒的设计。本设计采用了蜂鸣器发声来实现歌曲的播放,能保持基本音调不变,流畅播放出歌曲。现选用AT89S51单片机。主要设计模块包括数码管显示部分,功能键盘部分,蜂鸣器发声部分,彩灯部分。数码管采用共阳极数码管,通过单片机P1口控制,实现歌曲序号的显示;功能键盘采用按键开关,通过单片机P3口控制,实现歌曲播放顺序的调换和暂停播放功能;蜂鸣器由单片机的P2口控制,实现歌曲播放;彩灯是由普通发光二极管
2、代替,能实现单色长亮和闪烁效果。主要工作过程是通过按下功能键实现上一首和下一首及暂停播放,同时有数码管显示当前播放歌曲的序号,蜂鸣器播放出音乐,当播放最后一首夜曲时还伴有彩灯闪烁。此次设计要利用单片机及KeilC51编程软件编程和PROTEUS单片机仿真软件和电子电工等方面知识,用KeilC51编程软件编程,用PROTEUS单片机仿真软件仿真。最后制作实物,将程序下载到单片机中,利用I/O口产生一定频率的方波,驱动蜂鸣器,发出不同的音调,从而演奏乐曲。关键词:AT89S51单片机方波音调AbstractInordertoachievesingle-chipcontrolmusicplayba
3、ck,Thedesignmadeanattemptto,Thatthedesignofelectronicmusicbox,Thisdesignusesabuzzersoundtoachievethesongplaying,canmaintainthesamebasictone,smoothplaybackofsongs.AT89S51microcontrollerisused.
Majordesignmodulesincludedigitaldisplaypart,functionkeyboardparts,someofthebuzzersound,lightsparts.Usingcom
4、monanodeLEDdigitaltube,throughtheP1portcontrolchiptorealizethesongnumberdisplay;functionkeyboardwithkeyswitch,controlledbymicrocontrollerportP3,playingsongsinordertoachievetheexchangeandpausefunctions;buzzerbythemicrocontrollerP2portcontrol,toachievethesongplaying;lightsarereplacedbytheordinaryligh
5、t-emittingdiodes,toachievelonglightandcolorflashingeffect.
Mainworkprocessisachievedbypressingthefunctionkeyandthenextoneonthehead,andapause,whileadigitaldisplayserialnumberofthecurrentlyplayingsong,buzzerplayingthemusic,whenplayedwiththelastoneNocturneShihailights
Totakeadvantageofthechipdesignand
6、softwareprogrammingandprogrammingKeilC51PROTEUSmicrocontrollersimulationsoftwaresuchaselectricalandelectronicsknowledge,withKeilC51programmingsoftwareprogramming,microcontrollersimulationsoftwarewiththePROTEUSsimulation.Finally,thephysicalproduction,theprogramtothemicrocontroller,theuseofI/Oportsha
7、veacertainfrequencysquarewavetodrivethebuzzer,toissueadifferenttonetoplaymusic.
Keywords:AT89S51microcontrollersquarewavetone
目录摘要IAbstractII第1章绪论11.1概述1第2章音乐盒总体设计22.1设计功能要求22.2总体设计原理22.3总体设计框图3第3章芯片的选择和介绍4