【正文】
摘 要 電子琴是現(xiàn)代電子科技與音樂結合的產物,是一種新型的鍵盤樂器。它在現(xiàn)代音樂扮演著重要的角色,單片機具有強大的控制功能和靈活的編程實現(xiàn)特性,它已經溶入現(xiàn)代人們的生活中,成為不可替代的一部分。本文的主要內容是用 AT89c51 單片機為核心控制元件,設計一個電子琴。以單片機作為主控核心,與鍵盤、揚聲器等模塊組成核心主控制模塊,在主控模塊上設有 16 個按鍵和揚聲器。本系統(tǒng)運行穩(wěn)定,其優(yōu)點是硬件電路簡單,軟件功能完善,控制系統(tǒng)可靠,性價比較高等,具有一定的實用和參考價值 。 關鍵字: 單片機 89C51 LM386 基于單片機控制的 電子琴 設計 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 基于單片機控制的 電子琴 設計 3 目錄 緒論 ................................................................................................................................. 4 第一章 總體方案 ............................................................................................................. 5 系統(tǒng)設計要求 ...................................................................................................... 5 電子琴系統(tǒng)的組成 .............................................................................................. 5 系統(tǒng)框圖 ............................................................................................................ 5 第二章 硬件簡介 ............................................................................................................. 7 AT89C51 .............................................................................................................. 7 AT89C51 簡介 ............................................................................................ 7 主要的功能特性 ........................................................................................ 7 管腳功能 ................................................................................................... 8 芯片擦除 ................................................................................................... 9 矩陣式鍵盤的識別 .............................................................................................. 9 . 矩陣式鍵盤的結構 與工作原理 .................................................................. 9 . 矩陣式鍵盤的按鍵識別方法 .................................................................... 10 . 鍵盤接口必須具有的 4 個基本功能。 ...................................................... 10 LM386 音頻放大電路 ..........................................................................................11 LM386 音頻放大電路原理 .........................................................................11 LM386 引腳圖 .......................................................................................... 12 LM386 應用電路 ...................................................................................... 13 用 LM386 設計的音頻放大電路 ................................................................ 16 第三章 軟件設計 ........................................................................................................... 17 音樂彈奏設計 ................................................................................................... 17 整體程序處理流程圖 ......................................................................................... 18 第四章 調試與制作 ........................................................................................................ 20 調試過程 .......................................................................................................... 20 制作過程 .......................................................................................................... 20 第五章 結論 .................................................................................................................. 23 致 謝 ........................................................................................................................... 24 參考資料 ........................................................................................................................ 25 附錄 1 單片機口線分布 .................................................................................................. 26 附錄 2 完整程序 ............................................................................................................ 27 附錄 3 電路原理圖 ....................................................................................................... 32 附錄 4 PCB 制版 ..............................................................