【正文】
摘 要 電子琴是現(xiàn)代電子科技與音樂結(jié)合的產(chǎn)物,是一種新型的鍵盤樂器。它在現(xiàn)代音樂扮演著重要的角色,單片機(jī)具有強(qiáng)大的控制功能和靈活的編程實(shí)現(xiàn)特性,它已經(jīng)溶入現(xiàn)代人們的生活中,成為不可替代的一部分。本文的主要內(nèi)容是用 AT89c51 單片機(jī)為核心控制元件,設(shè)計(jì)一個(gè)電子琴。以單片機(jī)作為主控核心,與鍵盤、揚(yáng)聲器等模塊組成核心主控制模塊,在主控模塊上設(shè)有 16 個(gè)按鍵和揚(yáng)聲器。本系統(tǒng)運(yùn)行穩(wěn)定,其優(yōu)點(diǎn)是硬件電路簡單,軟件功能完善,控制系統(tǒng)可靠,性價(jià)比較高等,具有一定的實(shí)用和參考價(jià)值 。 關(guān)鍵字: 單片機(jī) 89C51 LM386 基于單片機(jī)控制的 電子琴 設(shè)計(jì) 2 Abstract Electronic an is a modern electronic music technology and the product is a new type of keyboard instruments. It played an important role in modern music. MCU has powerful control functions and flexible programming characteristics. It has converged with modern people39。s lives, bee an irreplaceable part. The main content is AT89C51 control of the core ponents, design of a electronic an. MCU as a host to the core, with the keyboard, speaker and other core modules. In the main control module has 16 keys and a speaker. The system is steady, its simple hardware circuits, software functions, reliability of control system and high cost performance is its advantages. It also has certain practical and reference value. Keywords: MCU 89C51 LM386 基于單片機(jī)控制的 電子琴 設(shè)計(jì) 3 目錄 緒論 ................................................................................................................................. 4 第一章 總體方案 ............................................................................................................. 5 系統(tǒng)設(shè)計(jì)要求 ...................................................................................................... 5 電子琴系統(tǒng)的組成 .............................................................................................. 5 系統(tǒng)框圖 ............................................................................................................ 5 第二章 硬件簡介 ............................................................................................................. 7 AT89C51 .............................................................................................................. 7 AT89C51 簡介 ............................................................................................ 7 主要的功能特性 ........................................................................................ 7 管腳功能 ................................................................................................... 8 芯片擦除 ................................................................................................... 9 矩陣式鍵盤的識(shí)別 .............................................................................................. 9 . 矩陣式鍵盤的結(jié)構(gòu) 與工作原理 .................................................................. 9 . 矩陣式鍵盤的按鍵識(shí)別方法 .................................................................... 10 . 鍵盤接口必須具有的 4 個(gè)基本功能。 ...................................................... 10 LM386 音頻放大電路 ..........................................................................................11 LM386 音頻放大電路原理 .........................................................................11 LM386 引腳圖 .......................................................................................... 12 LM386 應(yīng)用電路 ...................................................................................... 13 用 LM386 設(shè)計(jì)的音頻放大電路 ................................................................ 16 第三章 軟件設(shè)計(jì) ........................................................................................................... 17 音樂彈奏設(shè)計(jì) ................................................................................................... 17 整體程序處理流程圖 ......................................................................................... 18 第四章 調(diào)試與制作 ........................................................................................................ 20 調(diào)試過程 .......................................................................................................... 20 制作過程 .......................................................................................................... 20 第五章 結(jié)論 .................................................................................................................. 23 致 謝 ........................................................................................................................... 24 參考資料 ........................................................................................................................ 25 附錄 1 單片機(jī)口線分布 .................................................................................................. 26 附錄 2 完整程序 ............................................................................................................ 27 附錄 3 電路原理圖 ....................................................................................................... 32 附錄 4 PCB 制版 ..............................................................