目 录
设计总说明 I
DESIGN INTRODUCTION II
1绪论 1
1.1单片机基本概念 1
1.2单片机的产生和发展 1
1.3单片机的应用 2
1.4MCS-51 系列单片机介绍 2
1.4.1基本特性 2
1.4.2 引脚功能 3
1.4.2.1 时钟电路 3
1.4.2.2 控制信号 3
1.4.2.3 I/O口 4
1.4.3 MCS-51定时/计数器 6
1.4.3.1定时/计数器结构与工作原理 6
1.4.3.2 8051定时器模式的工作 8
1.4.3.3 定时计数器相关控制寄存器 8
2系统硬件设计 11
2.1单片机硬件系统设计原则 11
2.2系统功能说明 11
2.3硬件电路图 12
2.4各元件说明 14
2.4.1 LCD简介 14
2.4.1.1 LCD特性 14
2.4.1.2 键盘扫描 14
3系统软件设计 17
3.1 以定时器产生各种频率的声音 17
3.1.1 原理及说明 17
3.2 程序说明 18
3.3 流程图 20
4程序软件调试 21
4.1 KEIL软件调试程序过程 21
4.2 WAVE(伟福)软件调试程序结果 25
鸣 谢 28
参考文献 28
附 录 29
设计总说明
可存储式电子琴利用单片机定时器来产生固定频率的方波信号推动喇叭发出旋律,使用LCD显示器来显示音阶输入的相关消息,当按下键盘组相对按键,喇叭会发出相对音阶单音,共有两个8度音阶,所输入的单音会存入8051内而保存起来至多可以输入64个单音,可以把输入的单音一起演奏出来,有清除存储功能,再重新输入,演奏时可以按键来中断。
本设计首先在绪论介绍单片机的基础知识、应用、发展趋势及本设计所用到的单片机相关知识,第二章着重描述了可存储式电子琴的硬件电路设计、硬件设计框图及所使用的各种元件功能与特性,第三章重点剖析了软件设计的过程,第四章论述程序调试过程及结果。
关键词:单片机;定时器;计数器;电子琴
DESIGN INTRODUCTION
In the design of storable electronic piano, the timer of Single-Chip Microcomputer can be used to generate fixed trumpet and give birth to melodies, the scale of the relevant information can be shown with the LCD displayer, click when pressed keyboard Group relative, speaker will be issue the relative scale, 2 of 8 degrees scale, imported in 8051, scales will be imported and deposited up to 64 scales, can be imported to perform single out, the removal of storage functions, re-entry, can click to perform interruption.
First, the basic knowledge, application, development trends and the design of Single-Chip Microcomputer were introduced. Second, storable electronic organ hardware circuit design, hardware design and diagram of the various functional components and characteristics were given. Third, the software design process was analyzed. Finally, the process and result of procedure debugging with the Wave software and Keil software were introduced.
KEYWORDS: Single-Chip Microcomputer; timer; counter; electronic piano
可存储式电子琴系统设计
1 绪论
近年来随着计算机在社会领域的渗透, 单片机的应用正在不断地走向深入,同时带动着工业、农业、商业以及家电、玩具日新月异更新。本设计综合利用所学的软硬件知识进行设计是对大学期间学习、研究及实践成果的全面总结,利用单片机8051的控制程序设计可存储式电子琴,可以自己弹奏音乐,自动存储所输入的单音,稍后一起自动演奏出来。
1.1 单片机基本概念
单片微型计算机(Single-Chip Microcomputer),简称单片机。就是将微处理器(CPU)、存储器(存放程序或数据的ROM和RAM)、总线、定时器/计数器、输入/输出接口(I/O口)和其他多种功能器件集成在一块芯片上的微型计算机。由于单片机的重要应用领域为智能化电子产品,一般需要嵌入仪器设备内,故又称为嵌入式微控制器(Embedded Microcontroller)[1]。

您当前的位置:
