LED點(diǎn)陣顯示屏(全套源程序版)_第1頁(yè)
LED點(diǎn)陣顯示屏(全套源程序版)_第2頁(yè)
LED點(diǎn)陣顯示屏(全套源程序版)_第3頁(yè)
LED點(diǎn)陣顯示屏(全套源程序版)_第4頁(yè)
LED點(diǎn)陣顯示屏(全套源程序版)_第5頁(yè)
已閱讀5頁(yè),還剩42頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、編號(hào):it林電&科就盒母GUILINUNIVERSITYOFELECTRONICTECHNOLOGY單片機(jī)實(shí)訓(xùn)(論文)說明書題目:LED點(diǎn)陣模塊控制器院(系):應(yīng)用科技學(xué)院專業(yè):電子信息工程學(xué)生姓名:學(xué)號(hào):指導(dǎo)教師:2009年12月28日目錄引言1系統(tǒng)的設(shè)計(jì)與分析2LED點(diǎn)陣控制原理31.1.1LED簡(jiǎn)介31.1.2LED點(diǎn)陣41.1.3顯示原理51.1.4顯示屏的原理圖及結(jié)構(gòu)61.2單片機(jī)小系統(tǒng)851系列單片機(jī)的概述8單片機(jī)的組成8程序設(shè)計(jì)102.1系統(tǒng)程序的框架10串口通訊協(xié)議102.1.2顯示處理效果函數(shù)10顯示函數(shù)102.2程序流程圖93總結(jié)11謝辭13參考文獻(xiàn)14附錄(所有的源程序)

2、15摘要LED是發(fā)光二極管LightEmittingDiode的英文縮寫,是一種能夠?qū)㈦娔苻D(zhuǎn)化為可見光的半導(dǎo)體。LED點(diǎn)陣是由發(fā)光二極管排列組成的顯示器件,在我們?nèi)粘I畹碾娖髦须S處可見,極為普通也廣為人知。特別是它的發(fā)光類型屬于冷光源,效率及發(fā)熱量是普通發(fā)光器件難以比擬的,它采用低電壓掃描驅(qū)動(dòng),具有:耗電少、使用壽命長(zhǎng)、成本低、亮度高、故障少、視角大、可視距離遠(yuǎn)、規(guī)格品、可靠耐用、應(yīng)用靈活、安全、響應(yīng)時(shí)間短、綠色環(huán)保、控制靈活種等特點(diǎn)。目前LED顯示屏作為新一代的信息傳播媒體,已經(jīng)成為城市信息現(xiàn)代化建設(shè)的標(biāo)志。隨著社會(huì)經(jīng)濟(jì)的不斷進(jìn)步,以及LED顯示技術(shù)的不斷完善,人們對(duì)LED顯示屏的認(rèn)識(shí)將越

3、來(lái)越深入,其應(yīng)用領(lǐng)域?qū)?huì)越來(lái)越廣。本文設(shè)計(jì)一個(gè)16*64點(diǎn)陣模塊控制器,根據(jù)標(biāo)準(zhǔn)的08控制接口要求,可以驅(qū)動(dòng)市面上常見的16掃單色顯示屏,顯示漢字、英文、阿拉伯?dāng)?shù)字及其他信息等。整個(gè)系統(tǒng)提供很寬的外部擴(kuò)展,包括時(shí)鐘、溫濕度、亮度等常規(guī)點(diǎn)陣控制器的模塊。關(guān)鍵詞:LED點(diǎn)陣控制器;89S52;16掃;08接口AbstractLEDLightEmittingDiodeLightEmittingDiodeistheEnglishabbreviationisanelectricalenergyintovisiblelightcanbeasemiconductor.LEDdotmatrixiscompos

4、edoflight-emittingdiodearraydisplaydevices,theappliancesinourdailylifeeverywhere,itiscommonarealsowellknown.Inparticular,itbelongstothetypeoflight-emittingcoldlightsource,efficiency,andheatanordinarylight-emittingdevicesisdifficulttomatch,ituseslow-voltagescandriverwith:lowpowerconsumption,longlife,

5、lowcost,highbrightness,faultlesslargeangle,visualdistancespecificationproducts,reliableanddurable,applicationflexibility,security,responsetimeisshort,greenenvironmentalprotection,controlandflexiblekindsofcharacteristics.PresentLEDdisplayasanewgenerationofinformationandcommunicationmedia,hasbecomeasy

6、mbolofthemodernizationofcityinformation.Associalandeconomicadvances,aswellasLEDdisplaytechnologycontinuestoimprove,peoplesunderstandingoftheLEDdisplaywillbemorein-depth,itsapplicationswillbecomemorewidely.Thisdesignofa16*64DotMatrixmodulecontroller,accordingtothestandardcontrolinterfaceofthe08requir

7、ementsofthecommonmarketcandrive16scanmonochromedisplay,displayChinesecharacters,English,Arabic,andotherinformation.Throughoutthesystemprovidesawideexternalexpansion,includingclock,temperatureandhumidity,brightnessandotherconventionaldotmatrixcontrollermodule.Keywords:LEDdotmatrixcontroller。89S52。16s

8、weep。08Interface引言自20世紀(jì)80年代后期開始,隨著LED制造技術(shù)的不斷完善,在國(guó)外得到了廣泛的應(yīng)用。在我國(guó)改革開放之后,提別是進(jìn)入90年代國(guó)民經(jīng)濟(jì)的高速增長(zhǎng),對(duì)公眾場(chǎng)合發(fā)布信息的需求日益強(qiáng)烈。而LED顯示屏作為信息傳播的一種重要手段,已經(jīng)成為城市信息現(xiàn)代化建設(shè)的標(biāo)志,LED顯示屏隨著社會(huì)經(jīng)濟(jì)的不斷進(jìn)步,以及LED制造技術(shù)的完善,人們對(duì)LED顯示屏的認(rèn)識(shí)將會(huì)越來(lái)越深入,其應(yīng)用領(lǐng)域?qū)?huì)越來(lái)越廣;LED顯示屏經(jīng)多年的開發(fā)、研制、生產(chǎn),其技術(shù)目前已經(jīng)成熟?,F(xiàn)在各種廣告牌不再是白底黑字了,也不再是單一的非電產(chǎn)品,而是用上了豐富多彩的LED電子產(chǎn)品,為城市的增添了一道靚麗的風(fēng)景。而且它采

9、用低電壓掃描驅(qū)動(dòng),具有耗電少、使用壽命長(zhǎng)、成本低、發(fā)光效率高、故障少、視角大、可視距離遠(yuǎn)、可靠耐用、組態(tài)靈活、安全、響應(yīng)時(shí)間短、綠色環(huán)保、控制靈活、色彩豐富以及對(duì)室內(nèi)外環(huán)境適應(yīng)能力強(qiáng)等特點(diǎn)。近年來(lái)LED顯示屏市場(chǎng)得到了迅猛的發(fā)展,已經(jīng)廣泛應(yīng)用到銀行、郵電、稅務(wù)、機(jī)場(chǎng)、車站、證券市場(chǎng)及其它交易市場(chǎng)、醫(yī)院、電力、海關(guān)、體育場(chǎng)等需要進(jìn)行多種公告、宣傳的場(chǎng)合。因此,學(xué)習(xí)LED系統(tǒng)原理與工程技術(shù)很有必要。通過設(shè)計(jì)一個(gè)可顯示文字與圖形的16*64點(diǎn)陣控制器來(lái)學(xué)習(xí)和熟悉LED的使用。1系統(tǒng)的設(shè)計(jì)與分析本文是通過設(shè)計(jì)一個(gè)可顯示文字與圖形的16*64點(diǎn)陣控制器電路來(lái)學(xué)習(xí)和熟悉LED的使用,LED點(diǎn)陣控制器分為五

10、個(gè)模塊,系統(tǒng)框圖(如圖1),一是參數(shù)輸入部分,例如溫度、濕度、亮度等;二是字庫(kù)部分,如16點(diǎn)陣、24點(diǎn)陣或者32點(diǎn);三是單片機(jī)控制部份;四是接口部分(如圖2),一般采用08接口,如果需要不同的接口類型,可以根據(jù)08接口為基礎(chǔ)進(jìn)行轉(zhuǎn)接,這也是本系統(tǒng)采用08接口的原因之一;五是串口通訊部分(圖3),其中亮度、溫度、時(shí)鐘模塊由于時(shí)間的原因沒有完善,等待擴(kuò)展。串口通訶單片機(jī)標(biāo)準(zhǔn)接口MCU.SciDocATTXDRXD喏換AD.SchDocAD_CSADCLKADDIO時(shí)護(hù)TTMEScIiDdcDS1302RS:USISffiIO|DS1302CLKUCQMSdiDotJi羽_Interfac氐“hDx

11、PQ07圖2標(biāo)準(zhǔn)08接口部分二TXDOAD_CSADCLKadZdioQDS13O2RST|DSISOIOODS13O22CLKPO0.?20.3ZPOD.?二FYFLASI聿FLA莊ailay.SchDocSPI_NSS:SPZjCLKOSPIMOSI;SPINflSOU圖1系統(tǒng)框圖vcc|1卜POPO5卜PO5IPCMP20P21M3EP23OEDIE.VCCA3BOAlElAlBlAOE3A7E4Ai5B5A5BSA4B7GND74LVC245AU9DIE.VCCA3BOAlElAlBlAOE3A4E斗A5B5A6恥A7B7GNDEND均匚vcc|74LVC245AvcccsATlu45

12、X-D4XOEFstrrCLK_5S51LEETs5tvcccio江1:4SPZ_NSSSPZCLKp/mosi屹口0XOEl.-Rl71-IUGNDAGKDBGKDCOEDR1G1ElG2GNDSTRGNDCLK1.-R211HE-R2XE13152X-A斗X-E6X-C3X-D10l.-Gl121.-02斗STR15CLK5895工ga4HCcloK-50i-5sHo尸CTO;尸亠卻CT1jtWR-JF3,eF_70PJ口;2?ou2i:nrifirmn弓n口己nnnn匕nnnF-O.2S口RO.a導(dǎo)F-O.GF-Q_了EA/VPf31ALE/RFtOGF-SEMF-d了p-s.e電皿*目

13、PS.4F*2.3311Pa.a-oF*S_-|P-2_OfAS)圖9單片機(jī)的引腳說明圖9是89S52的內(nèi)部結(jié)構(gòu)圖,由圖可以看到在單片機(jī)內(nèi)部除了有CPU、RAM、ROM和定時(shí)器、串行口等主要功能部件之外,還有驅(qū)動(dòng)器、鎖存器、指令寄存器、地址寄存器等輔助電路部分,以及各功能模塊在單片機(jī)中的位置和相互關(guān)系。圖1089S52的內(nèi)部結(jié)構(gòu)2程序設(shè)計(jì)2.1程序的思路根據(jù)點(diǎn)陣的顯示原理就可以編寫出顯示函數(shù),整個(gè)程序的設(shè)計(jì)分為串口通訊協(xié)議、掃描程序函數(shù)、效果處理函數(shù)。串口通訊協(xié)議#p:為顯示圖片#c:為顯示漢字#l:為顯示英文#n:為顯示數(shù)字所有的控制命令必須以回車結(jié)束,指令接收并解碼正確則返回“Receiv

14、eOK”,否則返回“error”顯示處理效果函數(shù)本系統(tǒng)只做了兩個(gè)顯示效果,一個(gè)是閃爍,一個(gè)是左移。閃爍相對(duì)簡(jiǎn)單,先顯示延時(shí),清屏延時(shí),再顯示。左移則相對(duì)復(fù)雜,需要將顯示緩存的內(nèi)容全部左移一點(diǎn),左移的時(shí)候取前一個(gè)字節(jié)的低位等于后一個(gè)字節(jié)的低位,一屏移完一點(diǎn)后送顯示,再移一點(diǎn),這樣循環(huán)就可以實(shí)現(xiàn)了左移的效果。顯示函數(shù)這個(gè)函數(shù)是將顯示緩存的內(nèi)容送到顯示屏,做一個(gè)74HC595的驅(qū)動(dòng)即可,送完一行數(shù)據(jù)后點(diǎn)亮,再送下一行,這樣循環(huán)16次,就可以掃描完16行高的顯示屏。2.2程序流程圖主要程序見附錄??偨Y(jié)通過這次實(shí)訓(xùn),真正地做了一個(gè)點(diǎn)陣控制器,能顯示漢字、圖片、英文、數(shù)字,雖然之前有接觸過LED點(diǎn)陣,但是

15、一直是在門外看,沒有真正深入進(jìn)去實(shí)際操作,只是對(duì)顯示原理有個(gè)大概的了解;本來(lái)計(jì)劃將時(shí)鐘、亮度、溫度加入到整個(gè)系統(tǒng)中來(lái),這樣就更加接近實(shí)際應(yīng)用,但是由于時(shí)間的關(guān)系,只做了串口通訊部分進(jìn)去,而且功能也較為簡(jiǎn)單。在調(diào)試串口通訊花的時(shí)候是最多的,主要是因?yàn)榇谕ㄓ嵭酒c單片機(jī)的連接錯(cuò)誤,導(dǎo)致無(wú)法通訊。在整個(gè)實(shí)訓(xùn)過程中,真正能學(xué)到東西的是調(diào)試,雖然我們平常使用的Proteus仿真軟件也與實(shí)際差距越來(lái)越小,但是理論與實(shí)際的還是有相當(dāng)?shù)牟煌?,最關(guān)鍵的是發(fā)現(xiàn)問題,并解決問題,這樣會(huì)對(duì)以后的學(xué)習(xí)中都有較大的幫助。除此之外,在實(shí)訓(xùn)的過程中與其它同學(xué)之間互相溝通與交流,通過學(xué)習(xí)其它的設(shè)計(jì)思路,發(fā)現(xiàn)其優(yōu)點(diǎn)及缺點(diǎn),然后

16、一起討論,這有利于提高我們的綜合能力,為以后走上好的工作崗位打下堅(jiān)實(shí)的基礎(chǔ)。謝辭實(shí)訓(xùn)臨近結(jié)束了,在此過程中很多同學(xué)和老師都在耐心的幫助我。衷心感謝老師的悉心指導(dǎo)和同學(xué)們的熱情幫助,在我實(shí)訓(xùn)完成過程中,老師同學(xué)提供了許多寶貴意見,讓我學(xué)到了許多知識(shí),開闊了眼界,增強(qiáng)了我的動(dòng)手和動(dòng)腦能力。同時(shí),感激06級(jí)師兄的幫助,有了他們耐心的指導(dǎo)我做板,我才能在規(guī)定的時(shí)間完成這次實(shí)訓(xùn),并從中學(xué)到了更多的知識(shí)。我水平有限,所以這次設(shè)計(jì)還存在著許多不盡如人意的地方,歡迎老師和同學(xué)批評(píng)指正。此外,還要感謝我們學(xué)院為我們提供這個(gè)機(jī)會(huì)和必要物質(zhì)支持。參考文獻(xiàn)陳孟建等編著.C語(yǔ)言程序設(shè)計(jì)電子工業(yè)出版社,2006.6:19

17、36,171182.郭勇編著.Protel99SE印制電路板設(shè)計(jì)教程.機(jī)械工業(yè)出版社,2005.1:5150徐愛鈞,彭秀華編著.單片機(jī)高級(jí)語(yǔ)言c51windows環(huán)境編程與應(yīng)用.電子工業(yè)出版社,2001.7:1112,附錄具體程序如下串口通訊部分函數(shù)名稱:Interrupt_serial()傳入?yún)?shù):無(wú)函數(shù)功能:串口通訊協(xié)議1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*、t*、t*、t*、t*、t*、t*、t*、t*、t*、t*、t*、t*、t*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*/rT*rT*rT*zr*TxrT*rT*/voidInterr

18、upt_serial()interrupt4using1EA=0。if(RI)Serial_Int_tempReceiv_Count=SBUF。/Receiv_Count+。if(Receiv_Count=4)if(Serial_Int_tempReceiv_Count-2=0 x0d&Serial_Int_tempReceiv_Count-l=OxOa)以回車結(jié)尾Send_char(&Serial_Int_temp0,Receiv_Count)。if(Serial_Int_temp0=#)/指令格式switch(Serial_Int_templ)casep:Send_char(&Serial

19、_Recei_OK0,l0)。/命令正確,反饋接收成功信息break。casen:Send_char(&Serial_Recei_OK0,l0)。/命令正確,反饋接收成功信息break。casel:Send_char(&Serial_Recei_OK0,l0)。/命令正確,反饋接收成功信息break。casec:Send_char(&Serial_Recei_OK0,10)。/命令正確,反饋接收成功信息break。default:Send_char(&Serial_Error0,7)。/指令錯(cuò)誤break。scan_mod=Serial_Int_temp1。/顯示內(nèi)容cldispb()。/清緩

20、存elseSend_char(&Serial_Error0,7)。/指令錯(cuò)誤elseSend_char(&Serial_Error0,7)。/指令錯(cuò)誤Receiv_Count=0。/接收數(shù)據(jù)字節(jié)計(jì)數(shù)器if(Receiv_Count=39)Receiv_Count=0。RI=0。/清接收標(biāo)志EA=1。/開中斷函數(shù)名稱:displaylp()傳入?yún)?shù):無(wú)函數(shù)功能:掃描顯示屏/TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx/voiddisplaylp()u

21、chartemp,j,k,i。unsignedchar*point,*pointl。ucharhangxu=l。pointl=&disp_buf0。point=pointl。for(j=0。jvl6。j+)for(k=0。kplong。k+)temp=*point。for(i=0。i8。i+)CLK=0。Rl=l。if(temp&0 x80)=0 x00)Rl=0。CLK=l。temp=l。point+。OE=0。STR=0。STR=l。STR=0。Showline(j)。OE=l。ddlay(9)。OE=0。point=pointl+plong*(j)。/TxTxTxTxTxTxTxTxTx

22、TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx函數(shù)名稱:moveleft(unsignedcharsspp)傳入?yún)?shù):unsignedcharsspp移動(dòng)速度函數(shù)功能:左移顯示效果voidmoveleft(unsignedcharsspp)uchari,j,k。switch(scan_temp)casep:photo_todisp()。break。casel:letter_todisp()。break。casen:num_todisp()。break。casec:dztodisp()。br

23、eak。default:dztodisp()。break。for(i=0。ivplong。i+)屏的長(zhǎng)度f(wàn)or(j=0。j8。j+)leftoned()。/左移1點(diǎn)for(k=0。ksspp。k+)display1p()。if(scan_mod!=scan_temp)scan_temp=scan_mod。gotoexit。/是否接收到命令exit:。/退出標(biāo)記cldispb()。/清顯示緩存完整源程序1,main.c主函數(shù)/*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*/rr*rTrT*文件清單:main.c主函數(shù)code_area.c字庫(kù)表

24、display.c顯示相關(guān)函數(shù)com.c串口通信相關(guān)函數(shù)CPU含256BRAM現(xiàn)分配如下:00H-07FH程序常規(guī)使用128B7FH-FFH顯示緩存128B#include#include#include#include#include#defineuintunsignedint#defineucharunsignedcharucharSerial_Int_temp5。ucharReceiv_Count=0。/串口接收字節(jié)計(jì)數(shù)ucharscan_mod。sbitR1=P0A0。sbitR2=P0A1。sbitG1=P0A2。sbitG2=P0A3。sbitLL1=P0A4。sbitLL2=P0

25、A5osbitLL3=P0A6osbitLL4=P0A7osbitOE=P2A3osbitSTR=P2A2osbitCLK=P2A1ovoidmain()主函數(shù)/SetTime(0 x12,0 x23,0 x50)oSP=0X30oInit_com()oSend_char(&Serial_Strar_inf0,27)o/onedisp(20)owhile(1)cldispb()omoveleft(20)oflicker(5,5)o/*GetTime()o/讀DS1302temp=ADC0832()o*/函數(shù)名稱:Interrupt_serial()傳入?yún)?shù):無(wú)函數(shù)功能:串口通訊協(xié)議/TxTxT

26、xTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx/voidInterrupt_serial()interrupt4using1EA=0oif(RI)Serial_Int_tempReceiv_Count=SBUF。/Receiv_Count+。if(Receiv_Count=4)if(Serial_Int_tempReceiv_Count-2=0 x0d&Serial_Int_tempReceiv_Count-1=0 x0a)Send_char(&Serial_

27、Int_temp0,Receiv_Count)。if(Serial_Int_temp0=#)/指令格式switch(Serial_Int_temp1)casep:Send_char(&Serial_Recei_OK0,10)break。casen:Send_char(&Serial_Recei_OK0,10)break。casel:Send_char(&Serial_Recei_OK0,10)break。casec:Send_char(&Serial_Recei_OK0,10)break。/命令正確,反饋接收成功信息/命令正確,反饋接收成功信息/命令正確,反饋接收成功信息/命令正確,反饋接收成

28、功信息default:Send_char(&Serial_Error0,7)。/指令錯(cuò)誤break。scan_mod=Serial_Int_temp1。/顯示內(nèi)容cldispb()。elseSend_char(&Serial_Error0,7)。/指令錯(cuò)誤elseSend_char(&Serial_Error0,7)。/指令錯(cuò)誤Receiv_Count=0。if(Receiv_Count=39)Receiv_Count=0。RI=0。EA=1。Main.c所用到的頭文件源代碼:,display.h#define_DISPLAY_H#include#defineuintunsignedint#d

29、efineucharunsignedchar/externvoiddisplaylp()。顯示函數(shù)externvoidprocess_disbuf(unsignedcharchar_num)。externvoidonedisp(unsignedcharttime)。externvoiddisplaylp()。externvoidmoveleft(unsignedcharsspp)。externvoidcldispb(void)。/清顯示緩存區(qū)externvoidflicker(unsignedcharsspeed,unsignedcharstop)。/閃爍顯示/externvoiddispla

30、y(uintdisp_long,uchardisp_times,uchareffect)。/externvoiddisplay()。/externunsignedcharxdatadisp_bufl28。/externunsignedchardisp_buf32。,com.h#define_COM_H#include#defineuintunsignedint#defineucharunsignedcharexternvoidSend_char(uchar*Data_addr,ucharchar_num)。externunsignedcharcodeSerial_data42。externun

31、signedcharcodeSerial_Recei_OKl0。externunsignedcharcodeSerial_Error7。externunsignedcharcodeSerial_Strar_inf27。externvoidInit_com()。,main.h#define_MAIN_H#include#defineuintunsignedint#defineucharunsignedcharexternucharscan_mod。2,code_area.cLED點(diǎn)陣的字庫(kù)英文的ASCII為97-122(十進(jìn)制)61-7A(ASCII碼)#includeunsignedcharc

32、odenum_dotmatrix1016=/*-文字:0-*/*-宋體12。此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16-*/0 xFF,0 xFF,0 xFF,0 xE7,0 xDB,0 xBD,0 xBD,0 xBD,0 xBD,0 xBD,0 xBD,0 xBD,0 xDB,0 xE7,0 xFF,0 xFF,/*0,0*/0 xFF,0 xFF,0 xFF,0 xEF,0 x8F,0 xEF,0 xEF,0 xEF,0 xEF,0 xEF,0 xEF,0 xEF,0 xEF,0 x83,0 xFF,0 xFF,/*1,1*/0 xFF,0 xFF,0 xFF,0 xC3,0 xBD,0 xB

33、D,0 xBD,0 xFB,0 xFB,0 xF7,0 xEF,0 xDF,0 xBD,0 x81,0 xFF,0 xFF,/*2,2*/0 xFF,0 xFF,0 xFF,0 xC3,0 xBD,0 xBD,0 xFB,0 xE7,0 xFB,0 xF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 xF3,0 xFF,0 xFF,/*t,19*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 x39,0 xB

51、D,0 xBD,0 xBD,0 xBD,0 xB9,0 xC4,0 xFF,0 xFF,/*u,20*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 x18,0 xBD,0 xDB,0 xDB,0 xD7,0 xEF,0 xEF,0 xFF,0 xFF,/*v,21*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 x28,0 x6D,0 x6D,0 x55,0 x55,0 xBB,0 xBB,0 xFF,0 xFF,/*w,22*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xF

52、F,0 x91,0 xDB,0 xE7,0 xE7,0 xE7,0 xDB,0 x89,0 xFF,0 xFF,/*x,23*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 x18,0 xBD,0 xDB,0 xDB,0 xD7,0 xE7,0 xEF,0 xEF,0 x1F,/*y,24*/0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 x81,0 xBB,0 xF7,0 xEF,0 xEF,0 xDD,0 x81,0 xFF,0 xFF/*z,25*/。code_areac所用到的頭文件源代碼:(1),cod

53、e_area.h#define_CODE_AREA_H#include#defineuintunsignedint#defineucharunsignedcharexternunsignedcharcodenum_dotmatrix1016。externunsignedcharcodedotmatrix_chinese832。externunsignedcharcodepicture_code128。externunsignedcharcodeletter_matrix2616。/externvoiddisplay(unsignedcharchar_num)。顯示函數(shù)/externunsign

54、edcharxdatadisp_buf128。/externunsignedcharxdatadisp_buf64。關(guān)鍵的顯示子程序源代碼3,display.c*文件:display.c*功能:處理緩存及顯示/TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx/#include#include#include#include#i

55、nclude#definedispbuf_mul16/顯示屏行數(shù)#defineplong8/屏寬為8*8=64ucharscan_temp。/顯示內(nèi)容標(biāo)志sbitR1=P0A0。sbitR2=P0A1。sbitG1=P0A2。sbitG2=P0A3。sbitLL1=P0A4。sbitLL2=P0A5。sbitLL3=P0A6osbitLL4=P0A7osbitOE=P2A3osbitSTR=P2A2osbitCLK=P2A1ounsignedcharxdatadisp_bufplong*dispbuf_mulo/顯示屏寬度的單倍顯示緩存voiddztodisp(void)o/漢字?jǐn)?shù)據(jù)到顯示緩存

56、區(qū)voidphoto_todisp(void)o/圖片到緩存voidletter_todisp(void)o/字母到緩存voidnum_todisp(void)o/數(shù)據(jù)到顯示緩存區(qū)voidShowline(ucharline_num)o/行掃voidddlay(ucharms)o/延時(shí)voiddisplay1p()o/顯示函數(shù)voidmoveleft(unsignedcharsspp)o/左移顯示效果voidleftoned()o/左移一點(diǎn)voidflicker(unsignedcharsspeed,unsignedcharstop)o/閃爍顯示函數(shù)名稱:cldispb()傳入?yún)?shù):無(wú)函數(shù)功能

57、:清顯示緩存區(qū)voidcldispb(void)/清顯示緩存區(qū)uchar*disbuffouintiodisbuff=&disp_buf0ofor(i=0oiplong*dispbuf_muloi+)*disbuff=0 xffodisbuff+o函數(shù)名稱:onedisp()傳入?yún)?shù):unsignedcharttime顯示時(shí)長(zhǎng)函數(shù)功能:立即顯示/TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx/voidonedisp(unsignedcharttime

58、)uinti,stopt。dztodisp()。/計(jì)算緩存直接送入顯示緩存stopt=ttime*50。/顯示時(shí)間for(i=0。ivstopt。i+)display1p()。/調(diào)用掃描子程序cldispb()。/display1p()。函數(shù)名稱:flicker()傳入?yún)?shù):unsignedcharsspeed,ttime閃爍速度及持續(xù)時(shí)間函數(shù)功能:立即顯示voidflicker(unsignedcharsspeed,unsignedcharstop)/閃爍顯示uinti,kk,stopt,sped。ucharj。sped=sspeed*10。stopt=stop*10。for(j=0。j4。

59、j+)switch(scan_temp)casep:photo_todisp()。break。casel:letter_todisp()。break。casen:num_todisp()。break。casec:dztodisp()。break。default:dztodisp()。break。for(i=0。ivsped。i+)display1p()。cldispb()。for(i=0。isped。i+)display1p()。switch(scan_temp)casep:photo_todisp()。break。casel:letter_todisp()。break。casen:num_t

60、odisp()。break。casec:dztodisp()。break。default:dztodisp()。break。for(kk=0。kkvstopt。kk+)display1p()。/TxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTxTx函數(shù)名稱:photo_todisp()傳入?yún)?shù):函數(shù)功能:圖片數(shù)據(jù)到顯示緩存區(qū)*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論