毕业设计论文:基于51单片机的音乐发生器设计

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

本文是应用MCS-51单片机原理和控制理论技术设计音乐发生器的硬件电路,并利用C语言进行软件开发和程序设计。通过控制单片机内部的定时器产生不同频率的方波,驱动喇叭发出不同音调的音乐,再利用延迟控制发音时间的长短。把乐谱转化成相应的定时常数,从而达到从发音设备中演奏出悦耳动听的音乐的效果。

该音乐盒主要由按键电路、复位电路、时钟电路以及蜂鸣器组成。使用两个按键控制音乐盒,一个用来切换歌曲,另一个用来切换8路LED的变化花样,本音乐盒共有两首歌曲,花样灯花样共计3种。播放歌曲时,蜂鸣器发出某个音调,与之对应的LED亮起。本设计利用KEIL编程软件对音乐盒源程序进行编程并调试,配合PROTEUS仿真软件对硬件进行仿真调试,节约了设计时间。

本系统采用C语言进行软件设计。正文中首先简单描述系统硬件工作原理,且附以系统硬件设计框图,论述了本次毕业设计所应用的各硬件接口技术和各个接口模块的功能及工作过程。其次阐述了程序的流程和实现过程。本文撰写的主导思想是软、硬件相结合,以硬件为基础,来进行各功能模块的编写。

关键词

单片机;音乐;C语言;STC89C51;KEIL;PROTEUS

Abstract

In this paper, The music generator and its hardware circuit is designed by MCS-51 single-chip microcomputer principle and control theory, and the Software development and programming are based on C language programming. According to control the MCU internal timer to produce different frequency Square wave to drive the horn sounds of different tones of music, then use the delay to control the length of time. The music Transformationed into the timing constants corresponding so that the sound equipment can play Melodious music.

The music box is mainly composed of keypad circuit, reset circuit, clock circuit and a buzzer. Two buttons are used to control the music box, one to switch songs, another is used to switch the 8 LED pattern, the music box has two songs, a total of 3 kinds of pattern light pattern. While the music is playing, the buzzer sounded a tone, and the corresponding LED lights up. The design of programming the music box and debug source code using KEIL programming software, and to save the design time the PROTEUS simulation software is used to simulate the hardware debugging.

The system uses C language for software design. Firstly,

in the text describes the working principle of the system hardware, and attached to the system block diagram of hardware design to discusse the function and working process of the graduation design and the application of the hardware interface technology and the interface module. Secondly, expound the procedures and processes to achieve process. The main idea of this writing is a combination of software and hardware, on the base of hardware, write to each function module.

Key words

Singlechip; music; C language; STC89C51; KEIL; PROTEUS

目录

前言.................................. 错误!未定义书签。

1 概述 (2)

1.1 课题意义 (2)

1.2 国内外研究的现状及发展趋势 (2)

1.3 音乐发生器的扩展 (3)

1.3.1设计方案 (3)

2 51单片机介绍 (3)

2.1 Intel 51系列单片机 (3)

2.1.1 MCS-51单片机简述 (3)

2.1.2 8051与80C51的区别 (4)

2.1.3 8051单片机的引脚功能 (4)

2.2 51单片机内部结构 (6)

2.3 51系列的特性 (7)

2.4 并行I/O口 (7)

2.4.1 P0端口的结构及工作原理 (7)

2.4.2 P1端口的结构及工作原理 (9)

2.4.3 P2端口的结构及工作原理 (10)

相关文档
最新文档