當(dāng)前位置:首頁(yè) > 單片機(jī) > 單片機(jī)
[導(dǎo)讀]首先說下19264屏1926屏是由3個(gè)64*64 組成 64行 192列 其中192列 是64+64+64 =192 它們分別有CS1 CS2 CS3 控制 讓那個(gè)屏顯示 所以 每個(gè)屏最多只能顯示64行64列 切結(jié)8行 等于1頁(yè)。每頁(yè)只能最多寫8行 64列,8*64

首先說下19264屏

1926屏是由3個(gè)64*64 組成 64行 192列 其中192列 是64+64+64 =192

它們分別有CS1 CS2 CS3 控制 讓那個(gè)屏顯示 所以 每個(gè)屏最多只能顯示64行64列 切結(jié)8行 等于1頁(yè)。

每頁(yè)只能最多寫8行 64列,8*64 =512位 512/8 =64字節(jié)最多寫64字節(jié) 。。以上就是19264液晶屏的基本原理,雖然各個(gè)廠商硬件有所差異但原理基本相同。

以下給之前項(xiàng)目中使用的AT-C19264的驅(qū)動(dòng)部分代碼僅供參考!

C++ Code


#include "main.h"

#define __LCD_C__


const uchar code jie[]={

0x08,0x08,0x08,0xFF,0x88,0x68,0x24,0x2C,0xB4,0x25,0x26,0x34,0x2C,0x24,0x20,0x00,

0x02,0x42,0x81,0x7F,0x02,0x82,0x8A,0x4E,0x53,0x32,0x12,0x2E,0x42,0xC2,0x02,0x00 //"接",0

};

const uchar code di[]={


0x10,0x10,0x10,0xFE,0x10,0x50,0x40,0xFE,0x20,0x20,0xFF,0x10,0x10,0xF8,0x10,0x00,

0x20,0x20,0x10,0x1F,0x08,0x08,0x00,0x3F,0x40,0x40,0x4F,0x42,0x44,0x43,0x70,0x00//"地",1

};

const uchar code zu[]={

0x00,0xFF,0x11,0x29,0xC7,0x01,0xFE,0x22,0x22,0x22,0x22,0x22,0xFE,0x00,0x00,0x00,

0x00,0xFF,0x02,0x04,0x43,0x40,0x7F,0x42,0x42,0x42,0x42,0x42,0x7F,0x40,0x40,0x00//"阻",3

};

const uchar code ce[]={

0x08,0x31,0x86,0x60,0x00,0xFE,0x02,0xF2,0x02,0xFE,0x00,0xF8,0x00,0x00,0xFF,0x00,

0x04,0xFC,0x03,0x00,0x80,0x47,0x30,0x0F,0x10,0x67,0x00,0x07,0x40,0x80,0x7F,0x00//"測(cè)",0


};

const uchar code shi[]={

0x40,0x42,0xDC,0x08,0x00,0x90,0x90,0x90,0x90,0x90,0xFF,0x10,0x12,0x1C,0x10,0x00,

0x00,0x00,0x7F,0x20,0x10,0x20,0x20,0x1F,0x10,0x10,0x01,0x06,0x18,0x20,0x78,0x00//"試",1


};

const uchar code dian[]={

0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,

0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00,//"電",2

};

const uchar code liu[]={


0x10,0x60,0x01,0x86,0x60,0x04,0x44,0x64,0x55,0x4E,0x44,0x64,0xC4,0x04,0x04,0x00,

0x04,0x04,0xFC,0x03,0x40,0x30,0x0F,0x00,0x00,0x7F,0x00,0x3F,0x40,0x40,0x70,0x00//"流",3


};


const uchar code si[]={

0x00, 0xFC, 0x44, 0x44, 0x44, 0xFC, 0x10, 0x90, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x00,

0x00, 0x07, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x03, 0x40, 0x80, 0x7F, 0x00, 0x00, 0x00, 0x00//"時(shí)",0

};

const uchar code jian[]={


0x00, 0xF8, 0x01, 0x06, 0x00, 0xF0, 0x92, 0x92, 0x92, 0x92, 0xF2, 0x02, 0x02, 0xFE, 0x00, 0x00,

0x00, 0xFF, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x07, 0x40, 0x80, 0x7F, 0x00, 0x00//"間",1

};

const uchar code bao[]={

0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xFF,0xC1,0x41,0x41,0x49,0x51,0xCF,0x00,0x00,

0x01,0x41,0x80,0x7F,0x00,0x00,0x00,0xFF,0x40,0x23,0x14,0x1C,0x33,0x60,0x20,0x00

};

const uchar code jing[]={

0x20,0x1A,0xFA,0xAF,0xAA,0xEF,0x0A,0xFA,0x10,0x8F,0x54,0x24,0x5C,0x84,0x04,0x00,

0x02,0x02,0x02,0xEA,0xAA,0xAA,0xAB,0xAA,0xAB,0xAA,0xAA,0xEA,0x02,0x02,0x03,0x00

};

const uchar code bu[]={

0x08,0x08,0x89,0xCE,0x2A,0x98,0x48,0x00,0x00,0x00,0xFF,0x20,0x40,0x80,0x00,0x00,

0x02,0x01,0x00,0xFF,0x01,0x02,0x04,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x03,0x00

};

const uchar code cang[]={


0x40,0x20,0xF8,0x27,0x02,0x30,0x92,0x9C,0x90,0x9F,0x90,0x98,0x96,0x34,0x10,0x00,

0x00,0x00,0x7F,0x00,0x00,0x22,0x72,0x2A,0x2E,0x22,0x22,0x2A,0x72,0x22,0x02,0x00


};


const uchar code zero[]={


0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00, //"0",

0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00, //"1",

0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00, //"2",

0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00, //"3",

0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00, //"4",

0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00, //"5",

0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00, //"6",

0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00, //"7",

0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00, //"8",

0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00, //"9",


0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00 //"."



};

const uchar code m[]={


0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00



};

const uchar code R[]={

0x00,0x00,0xC0,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0xC0,0x00,0x00,0x00,


0x00,0x38,0x23,0x24,0x28,0x30,0x00,0x00,0x00,0x30,0x28,0x24,0x23,0x38,0x00,0x00

};



const uchar code A[]={

0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

};

const uchar code S[]={


0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

};



void delay_ms(uint dly) //@6MHz

{

unsigned char i, j;

while(dly!=0){

//_nop_();

//_nop_();

dly--;

i = 6;

j = 210;

do

{

while (--j);

} while (--i);

}

}


void send_bt(uint bty){

uchar i;

for (i=0;i<8;i++){

clk164 =0;

if (bty & 0x80)

dat164 = 1;

else

dat164 = 0;

clk164 = 1;

bty = bty << 1;

}

}




void lcd_write_command(uchar cmd){

//while(busy()); //返回1 死循環(huán) 測(cè)試忙

lcd_di =0;

lcd_rw =0;

send_bt(cmd);

lcd_e =1;

//delay(1);

_nop_();

lcd_e =0;

}


void lcd_write_data(uchar dat){

//while(busy()); //返回1 死循環(huán) 測(cè)試忙


lcd_di =1;

lcd_rw =0;

send_bt(dat);

lcd_e =1;

//delay(1);//防止 寫數(shù)據(jù) 與寫指令頻率太快

_nop_();


lcd_e =0;

}


void set_line(uchar line){

lcd_di =0;

lcd_rw =0;

line = 0xc0 | line;

lcd_write_command(line);

}


void set_page(uchar page){

lcd_di = 0;

lcd_rw = 0;

page = 0xb8 | page;

lcd_write_command(page);

}


void set_column(uchar col){

lcd_di = 0;

lcd_rw = 0;

col = col & 0x3f;

col = 0x40 | col;

lcd_write_command(col);

}


void select_screen(uchar swich){

//swich = 0x07 & swich;

switch(swich)

{

case 0:

{lcd_cs1=lcd_cs2=lcd_cs3 =0;

break;}

case 1:

{lcd_cs1=lcd_cs2 =0;

lcd_cs3 = 1;

break;}

case 2:

{lcd_cs1=lcd_cs3 = 0;

lcd_cs2 =1;

break;}

case 3:

{lcd_cs1=0;

lcd_cs2=lcd_cs3 = 1;

break;}

case 4:

{lcd_cs1=1;

lcd_cs2=lcd_cs3=1;

break;}

case 5:

{lcd_cs1=lcd_cs3=1;

lcd_cs2 =0;

break;}

case 6:

{lcd_cs1=lcd_cs2=1;

lcd_cs3=0;

break;}

case 7:

{lcd_cs1=lcd_cs2=lcd_cs3=1;

break;}

default:

break;

}

}


void set_on_off(uchar swich){

lcd_di = 0;

lcd_rw = 0;

swich = 0x3e | swich;

lcd_write_command(swich);

}


void lcd_scr_clr(void){

uchar i,j;

lcd_cs1 =lcd_cs2 = lcd_cs3 =0;

set_line(0);

set_on_off(1);

set_column(0);

for (i=0;i<8;i++){

set_page(i);

for (j=0;j<64;j++){

lcd_write_data(0x00);

}

}


}


void lcd_init(void){

//while(busy()); //返回1 死循環(huán) 防止更改PO口繼電器

clr164=1;

lcd_rst=1;

lcd_scr_clr();

set_line(0);//這里是設(shè)置起始行


}


void di

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除。
換一批
延伸閱讀

9月2日消息,不造車的華為或?qū)⒋呱龈蟮莫?dú)角獸公司,隨著阿維塔和賽力斯的入局,華為引望愈發(fā)顯得引人矚目。

關(guān)鍵字: 阿維塔 塞力斯 華為

倫敦2024年8月29日 /美通社/ -- 英國(guó)汽車技術(shù)公司SODA.Auto推出其旗艦產(chǎn)品SODA V,這是全球首款涵蓋汽車工程師從創(chuàng)意到認(rèn)證的所有需求的工具,可用于創(chuàng)建軟件定義汽車。 SODA V工具的開發(fā)耗時(shí)1.5...

關(guān)鍵字: 汽車 人工智能 智能驅(qū)動(dòng) BSP

北京2024年8月28日 /美通社/ -- 越來越多用戶希望企業(yè)業(yè)務(wù)能7×24不間斷運(yùn)行,同時(shí)企業(yè)卻面臨越來越多業(yè)務(wù)中斷的風(fēng)險(xiǎn),如企業(yè)系統(tǒng)復(fù)雜性的增加,頻繁的功能更新和發(fā)布等。如何確保業(yè)務(wù)連續(xù)性,提升韌性,成...

關(guān)鍵字: 亞馬遜 解密 控制平面 BSP

8月30日消息,據(jù)媒體報(bào)道,騰訊和網(wǎng)易近期正在縮減他們對(duì)日本游戲市場(chǎng)的投資。

關(guān)鍵字: 騰訊 編碼器 CPU

8月28日消息,今天上午,2024中國(guó)國(guó)際大數(shù)據(jù)產(chǎn)業(yè)博覽會(huì)開幕式在貴陽(yáng)舉行,華為董事、質(zhì)量流程IT總裁陶景文發(fā)表了演講。

關(guān)鍵字: 華為 12nm EDA 半導(dǎo)體

8月28日消息,在2024中國(guó)國(guó)際大數(shù)據(jù)產(chǎn)業(yè)博覽會(huì)上,華為常務(wù)董事、華為云CEO張平安發(fā)表演講稱,數(shù)字世界的話語(yǔ)權(quán)最終是由生態(tài)的繁榮決定的。

關(guān)鍵字: 華為 12nm 手機(jī) 衛(wèi)星通信

要點(diǎn): 有效應(yīng)對(duì)環(huán)境變化,經(jīng)營(yíng)業(yè)績(jī)穩(wěn)中有升 落實(shí)提質(zhì)增效舉措,毛利潤(rùn)率延續(xù)升勢(shì) 戰(zhàn)略布局成效顯著,戰(zhàn)新業(yè)務(wù)引領(lǐng)增長(zhǎng) 以科技創(chuàng)新為引領(lǐng),提升企業(yè)核心競(jìng)爭(zhēng)力 堅(jiān)持高質(zhì)量發(fā)展策略,塑強(qiáng)核心競(jìng)爭(zhēng)優(yōu)勢(shì)...

關(guān)鍵字: 通信 BSP 電信運(yùn)營(yíng)商 數(shù)字經(jīng)濟(jì)

北京2024年8月27日 /美通社/ -- 8月21日,由中央廣播電視總臺(tái)與中國(guó)電影電視技術(shù)學(xué)會(huì)聯(lián)合牽頭組建的NVI技術(shù)創(chuàng)新聯(lián)盟在BIRTV2024超高清全產(chǎn)業(yè)鏈發(fā)展研討會(huì)上宣布正式成立。 活動(dòng)現(xiàn)場(chǎng) NVI技術(shù)創(chuàng)新聯(lián)...

關(guān)鍵字: VI 傳輸協(xié)議 音頻 BSP

北京2024年8月27日 /美通社/ -- 在8月23日舉辦的2024年長(zhǎng)三角生態(tài)綠色一體化發(fā)展示范區(qū)聯(lián)合招商會(huì)上,軟通動(dòng)力信息技術(shù)(集團(tuán))股份有限公司(以下簡(jiǎn)稱"軟通動(dòng)力")與長(zhǎng)三角投資(上海)有限...

關(guān)鍵字: BSP 信息技術(shù)
關(guān)閉
關(guān)閉