文档详情

单片机课程设计-数字音乐盒设计.doc

发布:2017-09-01约1.69万字共36页下载文档
文本预览下载声明
目录 摘 要 I Abstract II 第一章 设计方案的对比 1 第二章 总体方案设计 2 2.1 原理简介 2 2.2 方案设计思想 2 第三章 方案实现 3 3.1、音频脉冲的产生 3 3.2.音乐节拍的生成 4 3.3.建立音乐的步骤 4 第四章 硬件设计 5 4.1 硬件电路 5 4.1.1、AT89C51的工作特性 5 4.2 原理说明 6 4.3 电路各模块说明 6 4.3.1 键盘系统 6 4.3.2 放大电路 7 4.3.3 时钟电路 8 4.3.4 复位电路 8 5.3.5 显示电路 9 第五章 软件设计 10 5.1 主模块的设计 10 第六章 仿真、安装和调试 12 总结 13 致谢 14 参考文献 14 附录 15 附录一:音乐程序 15 附录二:基于单片机的数字音乐盒总电路图 32 摘 要 本设计是基于单片机的数字音乐盒设计,由单片机AT89C51芯片和LCD显示器为核心,辅以必要的电路,构成的一个单片机电子数字音乐盒。要求利用I/O口产生一定频率的方波,驱动蜂鸣器,发出不同的音调并采用LCD显示信息,从而演奏乐曲(最少三首乐曲,每首不少于30秒),开机时有英文欢迎提示字符,播放时显示歌曲序号(或名称),可通过功能键选择乐曲,暂停,播放。 本设计采用4*4键盘,用Protel99来画系统硬件图,采用汇编语言进行编程,编程后利用KEIL C51来进行编译,再生成的HEX文件装入芯片中,采用proteus软件来仿真,检验功能得以正常实现。该音乐盒的设计可以通过按键选择不同的曲目,播放和暂停,并通过LCD显示歌曲号及播放时间。 本设计键盘采用动态扫描方式。每次扫描一行键盘,送此行低电平,读输入口的状态值,判断有没有键按下。若有键按下,根据读入口的值选择显示值并送至显示值寄存单元,判断键值,启动计数器T0,根据次值为偏移地址找到要选择的音乐的代码的首地址,根据代码产生一定频率的脉冲,驱动蜂鸣器,放出音。同时启动定时器T1,计算音乐的播放的时间。 关键词:数字音乐盒roteus软件4*4键盘动态扫描KEIL C5 Abstract The design of digital music box is based on singal-chip microc- omputer.The Chip of AT89C51 and LCD displayer was the heart of this design,with some necessary aided circuits,thus constructing the digital depends on singal-chip microcomputer.This design requires the I/O ports whitch have a certain frequency,square wave,then driving the buzzer to produce different tones,and LCD display information to play music(at least 3 songs,no less than 30 seconds per song),There have Englishwelcome prompt character and song number displayed on LCD when turn on the button.It can complited the music play or pause by select the function key. The design uses 4*4keyboard,with protel99 to draw the systerm hardware chart,assembly language progra-mming,programming for later use keil compiler,and then load the generated HEX filechip,using proteus simulation software,testing fun-ctions can be properly realized,The design of music box plays achived through the buttons to select a different track,pl-ay and pause,and through the LCD display the song number and play time. The dynamic scanning keyboard des
显示全部
相似文档