1、 I 摘 要 如今,单片机控制音乐播放的例子不胜枚举,音乐演奏系统也广泛的应用,而利用 单片机存储音乐,控制播放,弹奏乐曲更为广泛。它有功能多价格优外围电路简单 的特点,不仅很受音乐爱好者及音乐芯片制造商的热衷,而且是一般家庭都能承受得了 的经济投入范围之内。利用单片机发声键盘操作直观简单。对于初学者来说,是很容易 弹奏的。本设计为基于单片机的音乐演奏系统,设计出一种不仅要使单片机可以播放音 乐关键在于还有能够弹奏自己想弹奏的音乐。 本文设计出一种基于 STC89C52 的简单音乐演奏系统,利用单片机技术、LM386 音频功放芯片、4x4 键盘、SPEAKER、以及 74HC595 和 LED
2、 数码管实现原理图设计到 电路板设计开发,并用 C51 高级语言进行键盘识别程序设计和音频脉冲输出程序的设 计。最终能够实现乐曲演奏和自动播放音乐,并且可以通过 LED 数码管显示音符和音 调的高低。 关键词:STC89C52;音频脉冲;键盘识别;播放音乐 II Abstract At present, the examples of microcontroller control music playback is too numerous to enumerate, at the same time,the music performance system is also widely u
3、sed, make the best use of microcontroller which can store music, control playback, playing music.The advantage of the music performance system contains multiple functions,excellent price,simple peripheral circuit.The features of the music performance system not only popular with music lovers and mus
4、ic chip manufacturers, but also accepted by general family for it price.The keyboard operation is simple under the use of microcontroller.It is easy for beginner to play. The design of music performance system based on microcontroller, it can not only play music but also play the music which we want
5、 to. This paper designs a simple music system which is based on STC89C52 which make full use of microcontroller technology, the LM386 audio amplifier chip, 4x4 keyboard, SPEAKER, 74HC595 and LED digital tube.It realizes from schematic design to circuit board design and development, and use C languag
6、e accomplish keyboard identify program design and audio pulse output program design. Finally the design realizes the music play and auto play music,it can display the high or low of notes and tone through the LED digital tube . Key words: STC89C52; audio pulse; keyboard; play the music III 目 录 1 绪论 1 2 设计概述 3 2.1 主要器件的概述 . 3 2.2 设计思想 3 2.3 功能说明 3 2.4 电路图说明 4 3 单片机的介绍 6 3.1 单片机简介 6 3.2 单片机的发展 7 3.3 单片机内部结构 7 3.4 引脚电路连接及说明 10 3.5 引脚结合电路的说明 11 3.6 89C51 的展望 12 3.7 STC89C52 与 AT89C51 的区别 . 12 4 硬件