【正文】
技術的突飛猛進,單片機的功能也越來越強大,主要包括有:(1)單片機集成度高;(2)系統(tǒng)結構簡單,使用方便,實現(xiàn)模塊化; ?。?)單片機可靠性高,處理功能強,速度快; ?。?)低電壓,低功耗,便于生產(chǎn)便攜式產(chǎn)品 ; ?。?)控制功能強大。因此該數(shù)字音樂盒也就具有體積小,重量輕,能演奏各種各樣的音樂,功能多,外觀絢麗多彩,使用非常方便等諸多優(yōu)點。但是本文設計的數(shù)字音樂盒是以單片機為核心元件的數(shù)字音樂盒。隨著人類社會的發(fā)展,人們對于視聽方面的享受提出了更高的要求。如今,單片機在各個領域都起著至關重要的作用[1]。 PROTEUS。 AT89C51。與此同時,數(shù)碼管也不斷變化數(shù)字,以此顯示歌曲和彩燈花樣的序號。在停止演奏歌曲時三種彩燈花樣開始閃爍。本音樂盒一共設計了五首歌曲,同時還設計了三種LED彩燈的變化花樣。該音樂盒通過控制單片機內部的定時器來產(chǎn)生不同頻率的方波,驅動喇叭發(fā)出不同音調的音樂。基于51單片機的可控數(shù)字音樂盒設計摘 要本文是一篇基于AT89C51單片機的可控數(shù)字音樂盒的程序設計。該音樂盒是一個依據(jù)單片機技術原理,通過PROTEUS仿真軟件對硬件電路進行仿真制作以及利用KEIL軟件對音樂盒源程序進行C語言編譯,而設計制作出的一個多功能數(shù)字音樂盒。該程序通過把樂譜轉化成相應的定時常數(shù)來驅動發(fā)音設備演奏出悅耳動聽的音樂。在演奏歌曲時彩燈隨音調閃爍。歌曲和花樣均可隨意切換。關鍵詞:數(shù)字音樂盒;AT89C51;KEIL;PROTEUS;數(shù)碼管 THE DESIGNATION OF CONTROLLABLE DIGITAL MUSIC BOX BASED ON 51 SCM ABSTRACTThis paper explains the program designation of controllable digital music box based on AT89C51. This music box is designed by the idea that a multifunctional digital music box can be made based on the technical principle of single chip microputer (SCM), together with using the PROTEUS to simulate the hardware circuit and using KEIL to programme the source of music box which is piled with C language. This music box can produce square waves of different frequency in control of the timer inside SCM, and music of different tunes by driving speaker. The program is made use of to drive the sounding equipment to play pleasant music by the way of changing music score into the corresponding timing constant.This music box is totally designed with five songs, and also with three changeable patterns of LED colorful lights. While the songs are being performed, the colorful lights are flashing with tones. While the songs are stopped playing, the colorful lights start to flash with three changeable patterns. The songs and patterns can be free to switch. At the same time, the digital tube is also constantly changing figures to show the serial number of the songs and the patterns of the colorful lights.Key words: Digital music box。 KEIL。 Digital tube目 錄1 前言12 單片機和音樂盒硬件的功能2 AT89C51芯片的功能2 音樂盒的硬件及其功能43 數(shù)字音樂盒的主體設計方案5 音樂盒的主體結構5 主設計軟件的介紹5 編程軟件KEIL的簡介5 仿真軟件PROTEUS的簡介64 音樂盒硬件設計8 總設計框圖8 各部分硬件的作用8 LED和數(shù)碼管的設計95 音調和節(jié)拍的設計11 音調和節(jié)拍的設計以及音樂基礎知識11 音調和節(jié)拍的編碼136 源程序設計14 音樂程序14 LED花樣程序15 數(shù)碼管程序167 數(shù)字音樂盒總設計圖17 仿真總設計圖17 實物總設計圖188 結論19參考文獻20致謝21附錄A總程序源代碼及注釋221 前言隨著科技越來越發(fā)達,單片機技術也越來越純熟,單片機的應用也越來越廣泛,可以說幾乎很難找到哪個領域沒有單片機的蹤跡。單片機是一種集成在電路芯片,是采用超大規(guī)模集成電路技術把具有