標題:
LCD19264程序_STC12單片機主控
[打印本頁]
作者:
卡瓦格博15
時間:
2022-10-5 14:57
標題:
LCD19264程序_STC12單片機主控
分享剛剛寫好的19264屏程序,換點黑幣用用
IMG_20221005_143649.jpg
(3.25 MB, 下載次數(shù): 38)
下載附件
2022-10-5 14:54 上傳
單片機源程序如下:
#include "Delay.h"
#include <math.h>
#include "LCD19264.H"
#include "Self_Encoding.H"
#include "ADC.H"
uint number; //數(shù)字傳遞全局變量
uchar code *Char_Data; //指向程序儲存器的指針
uchar data temp[14]={2,0,2,2,1,0,0,1,2,3,2,5,4,8}; //為時鐘數(shù)字number傳遞臨存數(shù)組
char K = 0,DP; //顯示標題時,因分三段顯示,而保存已顯示過的位置
uchar Additional_Inputs;//其他字符或數(shù)字輸入值
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; //數(shù)據(jù)口先全部置位
LCD19264_RS = 0; //0 = 寫指令 1 = 寫數(shù)據(jù)
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指定區(qū) Num = 0 寫指令 Num = 1 寫數(shù)據(jù)
{
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 寫數(shù)據(jù)
LCD19264_RW = 0; // 低電平為 寫, 高電平為讀
LCD19264_RE = 1;
Delay_uS(1);
Por_Data_Out = COM_DATA;
LCD19264_RE = 0;
while(Read_Status()); //屏幕忙檢測,= 1 表示模塊在內(nèi)部操作,此時模塊不接受外部指令和數(shù)據(jù)
}
/*
void Display_Start_Line(uchar Designated_Area,uchar X) //顯示起始設(shè)置【指定區(qū)域 Designated_Area】 {1 , 1 ,(0~63) }
{
LCD19264_WriteByte(Designated_Area,0,0XC0|X); //【0 = 寫指令】
} */
void Set_Address_Y(uchar Designated_Area,uchar Address_Y) //設(shè)置列地址 {0 , 1,(0~63)}
{
LCD19264_WriteByte(Designated_Area,0,0X40|Address_Y); //【0 = 寫指令】
}
void Set_Page(uchar Designated_Area,uchar Page_Address) //設(shè)置頁地址
{
LCD19264_WriteByte(Designated_Area,0,0XB8|Page_Address);//【0 = 寫指令】
}
void LCD19264_Initialization() //LCD19264初始化
{
LCD19264_WriteByte(1,0,0X3e);//關(guān)閉顯示
LCD19264_WriteByte(1,0,0X02);
LCD19264_WriteByte(1,0,0X40);//設(shè)置 Y 地址
LCD19264_WriteByte(1,0,0XB8);//設(shè)置頁地址
LCD19264_WriteByte(1,0,0XC0);//設(shè)置顯示起始行
LCD19264_WriteByte(2,0,0X3e);//關(guān)閉顯示
LCD19264_WriteByte(2,0,0X02);//
LCD19264_WriteByte(2,0,0X40);//設(shè)置 Y 地址
LCD19264_WriteByte(2,0,0XB8);//設(shè)置頁地址
LCD19264_WriteByte(2,0,0XC0);//設(shè)置顯示起始行
LCD19264_WriteByte(3,0,0X3e);//關(guān)閉顯示
LCD19264_WriteByte(3,0,0X02);
LCD19264_WriteByte(3,0,0X40);//設(shè)置 Y 地址
LCD19264_WriteByte(3,0,0XB8);//設(shè)置頁地址
LCD19264_WriteByte(3,0,0XC0);//設(shè)置顯示起始行
}
/******************************************************************************************
*函數(shù)名稱: 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); //設(shè)置頁地址
LCD19264_WriteByte(1,0,0X40+i*2); //設(shè)置 Y 地址
LCD19264_WriteByte(1,1,Data1);
LCD19264_WriteByte(1,0,0X40+i*2 + 1);//設(shè)置 Y 地址
LCD19264_WriteByte(1,1,Data2);
// 【Num為屏幕的中顯示選擇項】
LCD19264_WriteByte(2,0,0XB8+j); //設(shè)置頁地址
LCD19264_WriteByte(2,0,0X40+i*2); //設(shè)置 Y 地址
LCD19264_WriteByte(2,1,Data1);
LCD19264_WriteByte(2,0,0X40+i*2 + 1);//設(shè)置 Y 地址
LCD19264_WriteByte(2,1,Data2);
// 【Num為屏幕的右顯示選擇項】
LCD19264_WriteByte(3,0,0XB8+j); //設(shè)置頁地址
LCD19264_WriteByte(3,0,0X40+i*2); //設(shè)置 Y 地址
LCD19264_WriteByte(3,1,Data1);
LCD19264_WriteByte(3,0,0X40+i*2 + 1);//設(shè)置 Y 地址
LCD19264_WriteByte(3,1,Data2);
}
}
}
復(fù)制代碼
Keil5代碼下載:
附件只含程序不含其它任何文件.7z
(66.07 KB, 下載次數(shù): 49)
2022-10-8 03:09 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
啤酒瓶子老大
時間:
2022-10-5 19:33
我也有2個19264的屏,好像是0108驅(qū)動的。下載學(xué)習(xí)一下。感謝分享。
作者:
miyuhao
時間:
2022-10-5 19:54
啥型號的19264啊
作者:
wdgao
時間:
2022-10-6 13:29
電路圖能分享一下嗎?
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1