单片机对19264液晶屏的驱动

畅学单片机 2022-08-10 11:23

首先说下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液晶屏的基本原理,虽然各个厂商硬件有所差异但原理基本相同。


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 codecang[]={


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);//这里是设置起始行


}

为了方便大家更好的学习,您还可以关注畅学电子和EDA的公众号,每天推送相关知识,希望能对你的学习有所帮助!



畅学单片机 以单片机为核心,带你全面了解和单片机相关的知识技巧,经验心得。关注我们,一起来学习吧!
评论
  • 时源芯微——RE超标整机定位与解决详细流程一、 初步测量与问题确认使用专业的电磁辐射测量设备,对整机的辐射发射进行精确测量。确认是否存在RE超标问题,并记录超标频段和幅度。二、电缆检查与处理若存在信号电缆:步骤一:拔掉所有信号电缆,仅保留电源线,再次测量整机的辐射发射。若测量合格:判定问题出在信号电缆上,可能是电缆的共模电流导致。逐一连接信号电缆,每次连接后测量,定位具体哪根电缆或接口导致超标。对问题电缆进行处理,如加共模扼流圈、滤波器,或优化电缆布局和屏蔽。重新连接所有电缆,再次测量
    时源芯微 2024-12-11 17:11 109浏览
  • 一、SAE J1939协议概述SAE J1939协议是由美国汽车工程师协会(SAE,Society of Automotive Engineers)定义的一种用于重型车辆和工业设备中的通信协议,主要应用于车辆和设备之间的实时数据交换。J1939基于CAN(Controller Area Network)总线技术,使用29bit的扩展标识符和扩展数据帧,CAN通信速率为250Kbps,用于车载电子控制单元(ECU)之间的通信和控制。小北同学在之前也对J1939协议做过扫盲科普【科普系列】SAE J
    北汇信息 2024-12-11 15:45 112浏览
  • 全球智能电视时代来临这年头若是消费者想随意地从各个通路中选购电视时,不难发现目前市场上的产品都已是具有智能联网功能的智能电视了,可以宣告智能电视的普及时代已到临!Google从2021年开始大力推广Google TV(即原Android TV的升级版),其他各大品牌商也都跟进推出搭载Google TV操作系统的机种,除了Google TV外,LG、Samsung、Panasonic等大厂牌也开发出自家的智能电视平台,可以看出各家业者都一致地看好这块大饼。智能电视的Wi-Fi连线怎么消失了?智能电
    百佳泰测试实验室 2024-12-12 17:33 53浏览
  • 应用环境与极具挑战性的测试需求在服务器制造领域里,系统整合测试(System Integration Test;SIT)是确保产品质量和性能的关键步骤。随着服务器系统的复杂性不断提升,包括:多种硬件组件、操作系统、虚拟化平台以及各种应用程序和服务的整合,服务器制造商面临着更有挑战性的测试需求。这些挑战主要体现在以下五个方面:1. 硬件和软件的高度整合:现代服务器通常包括多个处理器、内存模块、储存设备和网络接口。这些硬件组件必须与操作系统及应用软件无缝整合。SIT测试可以帮助制造商确保这些不同组件
    百佳泰测试实验室 2024-12-12 17:45 53浏览
  • 本文介绍瑞芯微RK3588主板/开发板Android12系统下,APK签名文件生成方法。触觉智能EVB3588开发板演示,搭载了瑞芯微RK3588芯片,该开发板是核心板加底板设计,音视频接口、通信接口等各类接口一应俱全,可帮助企业提高产品开发效率,缩短上市时间,降低成本和设计风险。工具准备下载Keytool-ImportKeyPair工具在源码:build/target/product/security/系统初始签名文件目录中,将以下三个文件拷贝出来:platform.pem;platform.
    Industio_触觉智能 2024-12-12 10:27 62浏览
  • 铁氧体芯片是一种基于铁氧体磁性材料制成的芯片,在通信、传感器、储能等领域有着广泛的应用。铁氧体磁性材料能够通过外加磁场调控其导电性质和反射性质,因此在信号处理和传感器技术方面有着独特的优势。以下是对半导体划片机在铁氧体划切领域应用的详细阐述: 一、半导体划片机的工作原理与特点半导体划片机是一种使用刀片或通过激光等方式高精度切割被加工物的装置,是半导体后道封测中晶圆切割和WLP切割环节的关键设备。它结合了水气电、空气静压高速主轴、精密机械传动、传感器及自动化控制等先进技术,具有高精度、高
    博捷芯划片机 2024-12-12 09:16 85浏览
  • 首先在gitee上打个广告:ad5d2f3b647444a88b6f7f9555fd681f.mp4 · 丙丁先生/香河英茂工作室中国 - Gitee.com丙丁先生 (mr-bingding) - Gitee.com2024年对我来说是充满挑战和机遇的一年。在这一年里,我不仅进行了多个开发板的测评,还尝试了多种不同的项目和技术。今天,我想分享一下这一年的故事,希望能给大家带来一些启发和乐趣。 年初的时候,我开始对各种开发板进行测评。从STM32WBA55CG到瑞萨、平头哥和平海的开发板,我都
    丙丁先生 2024-12-11 20:14 73浏览
  • 在智能化技术快速发展当下,图像数据的采集与处理逐渐成为自动驾驶、工业等领域的一项关键技术。高质量的图像数据采集与算法集成测试都是确保系统性能和可靠性的关键。随着技术的不断进步,对于图像数据的采集、处理和分析的需求日益增长,这不仅要求我们拥有高性能的相机硬件,还要求我们能够高效地集成和测试各种算法。我们探索了一种多源相机数据采集与算法集成测试方案,能够满足不同应用场景下对图像采集和算法测试的多样化需求,确保数据的准确性和算法的有效性。一、相机组成相机一般由镜头(Lens),图像传感器(Image
    康谋 2024-12-12 09:45 75浏览
  • 习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习笔记&记录学习习笔记&记学习学习笔记&记录学习学习笔记&记录学习习笔记&记录学习学习笔记&记录学习学习笔记记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记
    youyeye 2024-12-12 10:13 40浏览
  • 习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习笔记&记录学习习笔记&记学习学习笔记&记录学习学习笔记&记录学习习笔记&记录学习学习笔记&记录学习学习笔记记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记录学习学习笔记&记
    youyeye 2024-12-11 17:58 86浏览
我要评论
0
点击右上角,分享到朋友圈 我知道啦
请使用浏览器分享功能 我知道啦