(完整版)基于51单片机的自动音乐播放器设计毕业设计 下载本文

本科毕业论文(设计)

题 目: 基于51单片机的自动音乐播放

器设计

院 系: 电子与通信工程学院

专 业: 通信工程

姓 名: 张志顺

指导教师: 陈冬云

教师职称: 助教

填写日期: 2014年4月20日

摘 要

为了人们在快节奏的日常生活,优化工厂、事业单位、公司等的计时系统,采用了依靠单片机为基础设计了一种的自动音乐播放器。本设计利用单片机89C58RD+的计数和定时功能,来完成对时间的定时和显示功能。并且,通过对定时器初值的设定来产生不同频率的声音,利用定时器中断来对音乐节拍长度的控制。通过LM386N1音频功率放大器的音频放大功能,将单片机控制输出的信号放大,然后通过扩音器播放乐曲。通过MAX232型芯片,可以转换PC机上的电压和单片机的电源电压,再通过相应串口接入PC机,这样就能从PC机上将用C语言编写的程序代码下载到单片机上。最后可以在数码管上显示时间,当到达之前设定的时间之后,

扩音系统就会自动播放一段连续而美妙动听的音乐。此设计规避了传统闹钟的难听并且刺耳声音,而变成的是美妙动听的音乐,能给处于当前快节奏生活的人们的日常生活提供精确的计时,且因为成本较低,值得推广。

关键词:单片机;自动音乐播放;音频转换;时间显示;LM386N1音频

功率放大器。

Abstract

To people in the fast pace of daily life, optimization of factories, institutions, companies such as timing system, based on microcomputer was adopted to design a kind of automatic music player. This design using the single chip microcomputer 89 c58rd + count and timing functions, to complete the regular and display function of time. And, through to the setting of the initial value of timer to generate different frequencies of sound, using a timer interrupt to control of the beat of the music length. Through the audio amplifier function LM386N1 audio power amplifier, the single-chip microcomputer control output signal amplification, and then through loudspeakers. Through MAX232 chip, can convert the voltage of power supply voltage of PC and microcontroller, again through the corresponding access PC serial port, so you can from the PC to download program code written in C language to the single chip microcomputer. Last time can be displayed on the digital tube, when, after arriving in setting the time before the public address system will automatically play a continuous and delightful music. This design to avoid the traditional alarm clock ugly and give in the fast-paced life of the People's Daily life to provide accurate timing, and because of lower cost, is worth promoting.

Key words: single chip microcomputer; Automatic music playback; Audio conversion; Time display; LM386N1 audio power amplifier.