1、 基于单片机的自动音乐播放器的设计基于单片机的自动音乐播放器的设计 基于单片机的自动音乐播放器的设计基于单片机的自动音乐播放器的设计 摘摘 要要 为方便人们的日常生活,优化学校、机关等单位的计时系统,采用以单片机 为基础设计了一种的自动音乐播放器。 本设计利用单片机 89C58RD+的定时和计 数功能,来完成时间的显示和定时功能。并且,通过对定时器初值的设定来产生 不同频率的声音, 利用定时器中断来完成对音乐节拍长度的控制。 通过 LM386N1 音频功率放大器, 将单片机输出的信号放大, 再通过喇叭播放乐曲。 通过 MAX232 型芯片,可以转换 PC 机上的电压和单片机的电源电压,再通过串
2、口接入 PC 机, 这样就能从 PC 机上将用 C 语言编写的程序下载到单片机上。 最后可在数码管上 显示时间,当定时时间到后,喇叭自动播放一段连续的音乐。此设计摆脱了传统 闹钟的刺耳声音,取而代之的是美妙的音乐,能为人们的日常生活提供准确的计 时,且成本低廉,值得推广。 关键词关键词: :单片机;自动音乐播放;音频转换;时间显示;LM386N1 音频功率放大器 The design of automatic music player based on monolithic integrated circuit Abstract In order to facilitate peoples d
3、aily life, optimizes schools, institutions timing system, used has designed one kind of automatic music player which based on monolithic integrated circuit. This design fixed time and counts the function using monolithic integrated circuit 89C58RD+, completes the time the demonstration and fixed tim
4、e the function. And, Through hypothesis starting value of timer, product the different frequency sound. Severs using the timer completesthe control of music metre length.Through LM386N1 audio power amplifier, enlarges signal which the monolithic integrated circuit outputs,then broadcast music from loudspeaker. Through MAX232 chip,can transform PC machine on the voltage and the monolithic integrated circuit supply voltage.And then,turns on the computer though String mouth,then it can do