文档介绍:目录
摘要 I
Abstract II
第一章概述 1
引言 1
设计思路 1
方案论证 2
第二章系统总体方案及硬件设计 3
系统组成及总体框图 3
定时器的介绍 3
主要元件简介 4
STC89C51简介 4
蜂鸣器 5
键盘模块 7
键盘设计 7
键盘的结构与工作原理 7
设计键盘所实现的功能 8
流水灯模块 9
发声模块 10
复位电路 10
时钟电路………………………………………………………………………………….10
第三章乐理概述及软件设计 11
音乐相关知识 11
如何用单片机实现音乐的节拍 11
如何用单片机产生音频脉冲 12
软件设计框图 13
第四章系统的调试及仿真 14
软件与仿真介绍 15
仿真调试 14
硬件调试………………………………………………………………………………….15
软件调试………………………………………………………………………………….15
调试结果………………………………………………………………………………….15
结论 16
参考文献…………………………………………………………………………………………17
致谢 18
附录 19
附录1 原理图 19
附录2 PCB图 20
附录3 作品展示 21
基于单片机的电子琴设计制造
摘要:本设计选用STC89C51单片机进行电子琴主体方面的设计,实现了电子琴的基本功能。本设计主要运用了STC89C51单片机的定时、中断功能。利用定时器可较为方便地发出不同频率的脉冲信号,而这些脉冲信号经蜂鸣器后,由于蜂鸣器振荡频率的不同,就会发出不同的音调用以模拟音符。相对于市面上出售的电子琴,本设计具有价格廉、功耗低、体积小、便于携带等优点。新加入了流水灯设计,赋予了电子琴声与光相结合的新主题。本设计可实现对琴音较为精确的模拟,可以弹奏乐理中音部的全部音符。既能手动弹奏歌曲,又可实现单片机内部存储音乐的自动播放。
关键词:STC89C51,单片机,蜂鸣器,定时中断,播放
Microcontroller-based design and manufacture
Abstract :This design keyboard body design with STC89C51 single chip puter to realize the basic function of an. This design mainly USES the STC89C51 single chip puter timer, interrupt function. Using the timer can be more easily a different frequency pulse signals, the pulse signal after the buzzer, because of the different buzzer oscillation frequency, will produce different tones to imitate the notes.. This design is clever use of single-chip timer's principle of work, make each timer interrupt one will change the state of the buzzer, which form a rectangular square wave frequency signal. The frequency signal with the corresponding scales corresponding to simulate the musical notes. Is the frequency of square wave signal by the corresponding button control, you can manually play music. At the same time, the writing time delay process simulation to the beat, to control the duration of the each note voice, MCU internal storage can be realized automat