当前位置:首页 > 单片机 > 单片机
[导读]首先说下19264屏1926屏是由3个64*64 组成 64行 192列 其中192列 是64+64+64 =192 它们分别有CS1 CS2 CS3 控制 让那个屏显示 所以 每个屏最多只能显示64行64列 切结8行 等于1页。每页只能最多写8行 64列,8*64

首先说下19264屏

1926屏是由3个64*64 组成 64行 192列 其中192列 是64+64+64 =192

它们分别有CS1 CS2 CS3 控制 让那个屏显示 所以 每个屏最多只能显示64行64列 切结8行 等于1页。

每页只能最多写8行 64列,8*64 =512位 512/8 =64字节最多写64字节 。。以上就是19264液晶屏的基本原理,虽然各个厂商硬件有所差异但原理基本相同。

以下给之前项目中使用的AT-C19264的驱动部分代码仅供参考!

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//"测",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//"时",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 死循环 测试忙

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 死循环 测试忙


lcd_di =1;

lcd_rw =0;

send_bt(dat);

lcd_e =1;

//delay(1);//防止 写数据 与写指令频率太快

_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 死循环 防止更改PO口继电器

clr164=1;

lcd_rst=1;

lcd_scr_clr();

set_line(0);//这里是设置起始行


}


void di

本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除。
换一批
延伸阅读

9月2日消息,不造车的华为或将催生出更大的独角兽公司,随着阿维塔和赛力斯的入局,华为引望愈发显得引人瞩目。

关键字: 阿维塔 塞力斯 华为

加利福尼亚州圣克拉拉县2024年8月30日 /美通社/ -- 数字化转型技术解决方案公司Trianz今天宣布,该公司与Amazon Web Services (AWS)签订了...

关键字: AWS AN BSP 数字化

伦敦2024年8月29日 /美通社/ -- 英国汽车技术公司SODA.Auto推出其旗舰产品SODA V,这是全球首款涵盖汽车工程师从创意到认证的所有需求的工具,可用于创建软件定义汽车。 SODA V工具的开发耗时1.5...

关键字: 汽车 人工智能 智能驱动 BSP

北京2024年8月28日 /美通社/ -- 越来越多用户希望企业业务能7×24不间断运行,同时企业却面临越来越多业务中断的风险,如企业系统复杂性的增加,频繁的功能更新和发布等。如何确保业务连续性,提升韧性,成...

关键字: 亚马逊 解密 控制平面 BSP

8月30日消息,据媒体报道,腾讯和网易近期正在缩减他们对日本游戏市场的投资。

关键字: 腾讯 编码器 CPU

8月28日消息,今天上午,2024中国国际大数据产业博览会开幕式在贵阳举行,华为董事、质量流程IT总裁陶景文发表了演讲。

关键字: 华为 12nm EDA 半导体

8月28日消息,在2024中国国际大数据产业博览会上,华为常务董事、华为云CEO张平安发表演讲称,数字世界的话语权最终是由生态的繁荣决定的。

关键字: 华为 12nm 手机 卫星通信

要点: 有效应对环境变化,经营业绩稳中有升 落实提质增效举措,毛利润率延续升势 战略布局成效显著,战新业务引领增长 以科技创新为引领,提升企业核心竞争力 坚持高质量发展策略,塑强核心竞争优势...

关键字: 通信 BSP 电信运营商 数字经济

北京2024年8月27日 /美通社/ -- 8月21日,由中央广播电视总台与中国电影电视技术学会联合牵头组建的NVI技术创新联盟在BIRTV2024超高清全产业链发展研讨会上宣布正式成立。 活动现场 NVI技术创新联...

关键字: VI 传输协议 音频 BSP

北京2024年8月27日 /美通社/ -- 在8月23日举办的2024年长三角生态绿色一体化发展示范区联合招商会上,软通动力信息技术(集团)股份有限公司(以下简称"软通动力")与长三角投资(上海)有限...

关键字: BSP 信息技术
关闭
关闭