基于单片机的音乐流水灯设计

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

摘要

随着科技和经济的快速发展,人们对生活质量和生活环境的要求不断的提高,多彩多样的彩灯成了现今装饰和美化的时尚和潮流。千姿万态的流水灯能给人一种视觉冲击。拟采用单片机AT89C51去实现这种千变万化的流水灯。单片机技术是一种传统和典型的技术,具有智能化、体积小、集成度高和价格低廉等许多独特的优点。而且单片机明显优越于其他电子电路,其硬件电路和软件方面都不是特别复杂。

本设计将所学的单片机的理论和动手实践结合起来,主要利用AT89C51单片机设计并制作一个音乐流水灯。首先设计一个稳定的直流电源电路,然后设计一个复位电路,为单片机的正常工作提供条件,然后再设计时钟电路和声音驱动电路,可以使单片机能够更好的控制与编译音乐部分,另外还设计一个通信电路以方便单片机和PC机的连接与通信,最后还需要设计按键电路用来控制音乐流水灯。为了使蜂鸣器能够正常的发生还需设计一个音频电路。硬件电路设计后要将各模块连接起来进行仿真和调试。软件设计部分则需要将各电路模块进行编译,并设计音乐频率程序、流水灯程序和按键程序,同时将其进行仿真调试和组合调试。以实现在播放音乐时LED 灯有千变万化的效果,以满足对视觉上的享受。

关键词:单片机;音乐;流水灯;仿真;

ABSTRACT

With the science and technology and the economy the rapid development, people pairs quality of life and living environment the requirements of continuously improve, colorful and diverse of the lantern became a nowadays decorative and beautify's fashion and trend. Zi million-state of flowing water lamp can give a person one kinds visual impact. Intends to adopt AT89C51 microcontroller to go achieve such kaleidoscopic of flowing water lights. MCU technology is a kind of tradition and typical technical, with intelligent, the volume is small, high integration and price inexpensive and so on many unique advantages. Moreover single-chip obviously superior to other electronic circuit, its hardware circuits and software aspects of are not particularly complicated.

The single-chip design will combine theory and practice, the main use AT89C51 single-chip design of a musical water lights. First, design a stable DC power supply circuit, and then design a reset circuit for the microcontroller to provide normal working conditions, and then design a clock circuit and sound driver circuit, will enable MCU to better control and compile music part, in addition to design a to facilitate communication circuit chip and PC connectivity and communication, and finally also need to design the circuit to control the music keys light water. In order to make the buzzer to normal design an audio circuit needs to happen. After the hardware circuit design to connect the modules for simulation and debugging. Software design will need to be compiled each circuit module, and the design frequency of the music program, water lights and key procedures, and its combination of simulation debugging and debugging. When playing music in order to achieve a kaleidoscopic effect LED lights to meet the visual enjoyment.

Key words:MCU; Music; Light water;Simulation

目录

摘要 .................................................................................................................................... I ABSTRACT ......................................................................................................................... II 目录 . (1)

1. 绪论 (1)

1.1 单片机的概念 (1)

1.2 单片的历史、发展和应用 (4)

2. 总体设计 (6)

2.1 设计要求 (6)

2.2 设计方案选择 (6)

2.3 整体设计思路 (6)

3. 系统硬件设计与部分电路说明 (8)

3.1 硬件设计框图 (8)

3.2 部分电路说明 (8)

3.2.1 电源及启动电路 (8)

3.2.2 复位电路 (9)

3.2.3 时钟电路 (10)

3.2.4 通信电路 (10)

3.2.5 键盘电路 (11)

3.2.6 流水灯电路 (11)

3.2.7 音频电路 (12)

3.3 电路原理图及说明 (12)

4. 系统软件电路设计与分析 (13)

4.1 音乐程序设计 (13)

4.1.1 音乐程序流程图 (14)

4.2 流水灯设计 (16)

4.2.1 流水灯程序流程图 (16)

4.2.2 流水灯程序 (16)

4.3 音乐流水灯程序 (16)

4.3.1 音乐流水灯程序流程图 (16)

4.3.2 音乐流水灯程序 (17)

5. 系统调试与仿真 (19)

5.1 硬件调试 (19)

5.2 软件调试 (19)

5.3 软件仿真 (19)

总结 (22)

致谢 (23)

参考文献 (24)

附录一 (25)

附录二 (26)

附录三 (31)

附录四 (32)

相关文档
最新文档