基于protues仿真的AMPIRE X顯示器在單片機(jī)平臺(tái)的顯示_第1頁
基于protues仿真的AMPIRE X顯示器在單片機(jī)平臺(tái)的顯示_第2頁
基于protues仿真的AMPIRE X顯示器在單片機(jī)平臺(tái)的顯示_第3頁
基于protues仿真的AMPIRE X顯示器在單片機(jī)平臺(tái)的顯示_第4頁
基于protues仿真的AMPIRE X顯示器在單片機(jī)平臺(tái)的顯示_第5頁
已閱讀5頁,還剩1頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、中文資料文庫地址:#include<reg52.h>#include<intrins.h>#define uchar unsigned charsbit CS1=P24; sbit CS2=P23; sbit RS=P22; sbit RW=P21; sbit E=P20; void check_busy(); /忙檢測(cè)void write_cmd(uchar inst); /寫命令void write_data(uchar dat); /寫數(shù)據(jù)void set_xy(uchar x,uchar y); /設(shè)置顯示坐標(biāo)void LCD_Init(); /lcd初始化/

2、字摸軟件提取出的數(shù)據(jù),提取字模時(shí)要注意參數(shù)設(shè)置,縱向取模,字節(jié)倒序。uchar code HZ0632=/;- 文字: 安 -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=16x16 -0x80,0x90,0x8C,0x84,0x84,0x84,0xF5,0x86,0x84,0x84,0x84,0x84,0x94,0x8C,0x80,0x00,0x00,0x80,0x80,0x84,0x46,0x49,0x28,0x10,0x10,0x2C,0x23,0x40,0x80,0x00,0x00,0x00,/;- 文字: 徽 -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=16x16 -0x

3、10,0x88,0xC4,0x23,0xAE,0x68,0x2F,0x28,0xAE,0x20,0xD8,0x17,0x10,0xF0,0x10,0x00,0x01,0x00,0xFF,0x48,0x29,0x8D,0xFB,0x09,0xAC,0x48,0x37,0x08,0x36,0x41,0x80,0x00,/;- 文字: 工 -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=16x16 -0x00,0x04,0x04,0x04,0x04,0x04,0x04,0xFC,0x04,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x20,0x20,0x20,0x20

4、,0x20,0x20,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x20,0x20,0x00,/;- 文字: 業(yè) -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=16x16 -0x00,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,0xC0,0x30,0x00,0x00,0x40,0x40,0x40,0x43,0x40,0x7F,0x40,0x40,0x40,0x7F,0x42,0x41,0x40,0x40,0x40,0x00,/;- 文字: 大 -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=

5、16x16 -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xFF,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x80,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x03,0x0C,0x10,0x20,0x40,0x80,0x80,0x00,/;- 文字: 學(xué) -/;- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=16x16 -0x40,0x30,0x11,0x96,0x90,0x90,0x91,0x96,0x90,0x90,0x98,0x14,0x13,0x50,0x30,0x00,0x04,0x04,

6、0x04,0x04,0x04,0x44,0x84,0x7E,0x06,0x05,0x04,0x04,0x04,0x04,0x04,0x00;uchar code FZ01032=/*- 文字: I -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,/*- 文字: -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0

7、0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*- 文字: L -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,/*- 文字: O -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,/*- 文字: V -*/

8、*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,/*- 文字: E -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,/*- 文字: -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x00,0x00,0x00,0x00,

9、0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*- 文字: Y -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,/*- 文字: O -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,

10、0x0F,0x00,/*- 文字: U -*/*- 宋體12; 此字體下對(duì)應(yīng)的點(diǎn)陣為:寬x高=8x16 -*/0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00;/*延時(shí)函數(shù)*/void delayus(uchar delay)uchar i;for(i=0;i<=delay;i+)_nop_();/*忙檢查*/void check_busy()uchar a=0;for(a=0;a<200;a+); /此處為延時(shí),一段時(shí)間后確保處于空閑狀態(tài)/* /此處為狀態(tài)查詢,查詢忙狀態(tài)

11、,沒有使用成功,以后再調(diào)試RW=1;RS=0; E=1;while(1) E=1; if(!(P0&0x80) break; a+; if(a>10) break; E=1;*/ /*寫命令函數(shù)*/void write_cmd(uchar inst)check_busy();RS=0;RW=0;E=1;P3=inst;E=0;_nop_();/*寫數(shù)據(jù)函數(shù)*/void write_data(uchar dat)check_busy();RS=1;RW=0;E=1;P3=dat;E=0;_nop_();/*初始化函數(shù)*/void LCD_Init()write_cmd(0x30);

12、/30H-基本指令操作?delayus(4);write_cmd(0x0c);/開顯示,關(guān)光標(biāo),不閃爍。delayus(10);write_cmd(0x01);/清除顯示delayus(10);write_cmd(0x06);/光標(biāo)的移動(dòng)方向左,DDRAM的地址計(jì)數(shù)器(AC)加1。delayus(10);/*設(shè)置顯示坐標(biāo)*/void set_xy(uchar x,uchar y) /x為行,y為列if(y>=64) /列地址大于等于64時(shí)右屏顯示? CS2=0; /低電平選擇CS1=1; /寫右屏是左屏關(guān)閉,不然兩邊會(huì)同時(shí)顯示y=y-64;else /列地址小于64時(shí)左屏顯示 CS1=0

13、; /同上CS2=1;write_cmd(0x40|y); /寫列地址_nop_();write_cmd(0xb8|x); /寫行地址?/*顯示中文字體*/void disp_hz(uchar R,uchar L,uchar *p)uchar i;for(i=0;i<16;i+)set_xy(2*R,16*L+i); /設(shè)定顯示位置,每個(gè)漢字16*16個(gè)點(diǎn),顯示時(shí)每行8*16個(gè)點(diǎn),所以需要兩行8*32個(gè)點(diǎn),此處為第一行write_data(pi); /寫入DDRAMset_xy(2*R+1,16*L+i); /第二行write_data(pi+16);void disp_zf(uchar R,uchar L,uchar *p)uchar i;for(i=0;i<8;i+)set_xy(2*R,8*L+i); /設(shè)定顯示位置,每個(gè)字母16*8個(gè)點(diǎn),顯示時(shí)每行8*8個(gè)點(diǎn),所以需要兩行8*16個(gè)點(diǎn),此處為第

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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)論