- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
基于51单片机的音乐播放设计
基于51单片机的音乐播放设计
摘 要
为方便人们的日常生活,优化学校、机关等单位的计时系统,采用以单片机为基础设计了一种的自动音乐播放器。本设计利用单片机AT89S52的定时和计数功能,来完成时间的显示和定时功能。并且,通过对定时器初值的设定来产生不同频率的声音,利用定时器中断来完成对音乐节拍长度的控制。通过音频功率放大器,将单片机输出的信号放大,再通过喇叭播放乐曲。通过MAX232型芯片,可以转换PC机上的电压和单片机的电源电压,再通过串口接入PC机,这样就能从PC机上将用C语言编写的程序下载到单片机上。最后可在数码管上显示时间,当定时时间到后,喇叭自动播放一段连续的音乐。此设计摆脱了传统闹钟的刺耳声音,取而代之的是美妙的音乐,能为人们的日常生活提供准确的计时,且成本低廉,值得推广。
关键词:音乐播放;音频转换;时间显示;ULN2003
Music playback design based on 51 single chip microcomputer
Abstract
For the convenience of Peoples Daily lives, to optimize the timing system schools, agencies and other units, on the basis of the single chip microcomputer was adopted to design a kind of automatic music player.This design using the single chip microcomputer AT89S52 timing and counting functions, to complete the time display and timing functions.And, by the setting of the initial value of timer to generate different frequencies of sound, using a timer interrupt to complete control of the beat of the music length.Through the audio power amplifier, MCU output signal amplification, then play the music over the loudspeaker.Through MAX232 chip, can convert the voltage of power supply voltage of PC and microcontroller, through a serial port connected to the PC, so you can from the PC will be written in C language program downloaded to the microcontroller.Finally on the digital tube display time, when the time to regularly, speakers play a continuous music automatically.This design to get rid of the traditional alarm clock sharp voice, instead, the wonderful music, can offer the accurate timing for Peoples Daily lives, and low cost, is worth promoting.
Key words:Music playback;Audio conversion;Time display;ULN2003
目 录
1 总体设计 1
2 硬件设计 2
2.1 AT89S52型单片机介绍 2
2.2 ULN2003及外围电路的设计 2
2.3 串行通信和MAX232芯片 3
2.4 AT89S52的定时/计数器概述 3
2.5 LED显示 5
3 软件设计 6
3.1 音乐编程原理及其流程图 6
3.1.1 产生声音信号 6
3.1.2 产生节拍信号 6
3.1.3 音频转换 7
3.2 时间显示程序设计 8
4 仿真及调试过程 9
4.1 硬件调试过程 9
4.2 软件仿真过程 9
5 结束语 1
文档评论(0)