标题:
LCD19264程序_STC12单片机主控
[打印本页]
作者:
卡瓦格博15
时间:
2022-10-5 14:57
标题:
LCD19264程序_STC12单片机主控
分享刚刚写好的19264屏程序,换点黑币用用
IMG_20221005_143649.jpg
(3.25 MB, 下载次数: 38)
下载附件
2022-10-5 14:54 上传
单片机源程序如下:
#include "Delay.h"
#include <math.h>
#include "LCD19264.H"
#include "Self_Encoding.H"
#include "ADC.H"
uint number; //数字传递全局变量
uchar code *Char_Data; //指向程序储存器的指针
uchar data temp[14]={2,0,2,2,1,0,0,1,2,3,2,5,4,8}; //为时钟数字number传递临存数组
char K = 0,DP; //显示标题时,因分三段显示,而保存已显示过的位置
uchar Additional_Inputs;//其他字符或数字输入值
void STC15_Initialization() //STC15初始化
{
P0M0 = 0X00;
P0M1 = 0X00;
P1M0 = 0X00;
P1M1 = 0X00;
P2M0 = 0X00;
P2M1 = 0X00;
P3M0 = 0X00;
P3M1 = 0X00;
P4M0 = 0X04;
P4M1 = 0X00;
P5M0 = 0X00;
P5M1 = 0X00;
LDE_DATA = 1;
}
/**********************LCD检测是否忙*************************/
bit Read_Status() //屏幕忙检测
{
bit Temp;
Por_Data_Out = 0x00; //数据口先全部置位
LCD19264_RS = 0; //0 = 写指令 1 = 写数据
LCD19264_RW = 1; //低电平为 => 写 高电平为 => 读
LCD19264_RE = 1;
Delay_uS(1);
Temp =(bit)(Por_Data_Out& 0x00) ; //取最高位,1为忙
LCD19264_RE = 0;
return Temp ;
}
void LCD19264_WriteByte(uchar Designated_Area,uchar Num,uchar COM_DATA) //Designated_Area指定区 Num = 0 写指令 Num = 1 写数据
{
switch(Designated_Area)//【Num为屏幕的左,中,右显示选择项】
{
case 1:
LCD19264_CS1 = 0; LCD19264_CS2 = 1; LCD19264_CS3 = 1; //【Num为屏幕的左显示选择项】
break;
case 2:
LCD19264_CS1 = 1; LCD19264_CS2 = 0; LCD19264_CS3 = 1; //【Num为屏幕的中显示选择项】
break;
case 3:
LCD19264_CS1 = 1; LCD19264_CS2 = 1; LCD19264_CS3 = 0; //【 Num为屏幕的右显示选择项】
break;
}
LCD19264_RS = Num; // Num = 0 写指令 Num = 1 写数据
LCD19264_RW = 0; // 低电平为 写, 高电平为读
LCD19264_RE = 1;
Delay_uS(1);
Por_Data_Out = COM_DATA;
LCD19264_RE = 0;
while(Read_Status()); //屏幕忙检测,= 1 表示模块在内部操作,此时模块不接受外部指令和数据
}
/*
void Display_Start_Line(uchar Designated_Area,uchar X) //显示起始设置【指定区域 Designated_Area】 {1 , 1 ,(0~63) }
{
LCD19264_WriteByte(Designated_Area,0,0XC0|X); //【0 = 写指令】
} */
void Set_Address_Y(uchar Designated_Area,uchar Address_Y) //设置列地址 {0 , 1,(0~63)}
{
LCD19264_WriteByte(Designated_Area,0,0X40|Address_Y); //【0 = 写指令】
}
void Set_Page(uchar Designated_Area,uchar Page_Address) //设置页地址
{
LCD19264_WriteByte(Designated_Area,0,0XB8|Page_Address);//【0 = 写指令】
}
void LCD19264_Initialization() //LCD19264初始化
{
LCD19264_WriteByte(1,0,0X3e);//关闭显示
LCD19264_WriteByte(1,0,0X02);
LCD19264_WriteByte(1,0,0X40);//设置 Y 地址
LCD19264_WriteByte(1,0,0XB8);//设置页地址
LCD19264_WriteByte(1,0,0XC0);//设置显示起始行
LCD19264_WriteByte(2,0,0X3e);//关闭显示
LCD19264_WriteByte(2,0,0X02);//
LCD19264_WriteByte(2,0,0X40);//设置 Y 地址
LCD19264_WriteByte(2,0,0XB8);//设置页地址
LCD19264_WriteByte(2,0,0XC0);//设置显示起始行
LCD19264_WriteByte(3,0,0X3e);//关闭显示
LCD19264_WriteByte(3,0,0X02);
LCD19264_WriteByte(3,0,0X40);//设置 Y 地址
LCD19264_WriteByte(3,0,0XB8);//设置页地址
LCD19264_WriteByte(3,0,0XC0);//设置显示起始行
}
/******************************************************************************************
*函数名称: Disp_Dots
*功能描述: 显示点、 横、 竖
******************************************************************************************/
void Disp_Dots(uchar Data1, uchar Data2)//显示点,横,竖
{
uchar i, j;
for(j = 0; j < 8; j++)
{
for(i = 0; i < 32; i++)
{
// 【Num为屏幕的左显示选择项】
LCD19264_WriteByte(1,0,0XB8+j); //设置页地址
LCD19264_WriteByte(1,0,0X40+i*2); //设置 Y 地址
LCD19264_WriteByte(1,1,Data1);
LCD19264_WriteByte(1,0,0X40+i*2 + 1);//设置 Y 地址
LCD19264_WriteByte(1,1,Data2);
// 【Num为屏幕的中显示选择项】
LCD19264_WriteByte(2,0,0XB8+j); //设置页地址
LCD19264_WriteByte(2,0,0X40+i*2); //设置 Y 地址
LCD19264_WriteByte(2,1,Data1);
LCD19264_WriteByte(2,0,0X40+i*2 + 1);//设置 Y 地址
LCD19264_WriteByte(2,1,Data2);
// 【Num为屏幕的右显示选择项】
LCD19264_WriteByte(3,0,0XB8+j); //设置页地址
LCD19264_WriteByte(3,0,0X40+i*2); //设置 Y 地址
LCD19264_WriteByte(3,1,Data1);
LCD19264_WriteByte(3,0,0X40+i*2 + 1);//设置 Y 地址
LCD19264_WriteByte(3,1,Data2);
}
}
}
复制代码
Keil5代码下载:
附件只含程序不含其它任何文件.7z
(66.07 KB, 下载次数: 49)
2022-10-8 03:09 上传
点击文件名下载附件
下载积分: 黑币 -5
作者:
啤酒瓶子老大
时间:
2022-10-5 19:33
我也有2个19264的屏,好像是0108驱动的。下载学习一下。感谢分享。
作者:
miyuhao
时间:
2022-10-5 19:54
啥型号的19264啊
作者:
wdgao
时间:
2022-10-6 13:29
电路图能分享一下吗?
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1