RA8835參考例程
時間:2021-02-06作者:杭州佳顯科技有限公司瀏覽:255
我司專業(yè)設計生產(chǎn)單色液晶模塊、TFT液晶模塊、OLED顯示模塊,下面是其中一款RA8835主控芯片的參考例程,
如需要其他控制器的參考例程可與我聯(lián)系哦!
********************************
* Author Date : 2008/07/21
* Company : TSINGTEK
* Case : 320 x 240
* Device : AT89S52 at 12.0MHZ
* Compiled Using Keil C v7.50
***********************************/
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define LCD_BUS P1
sbit _RD=P3^0;
sbit _CS=P3^1;
sbit _RES=P3^4;
sbit A0=P3^2;
sbit _WR=P3^5;
uchar code systom[]={0x32,0x87,0x07,0x27,0x42,0xf0,0x28,0x00,};
uchar code scroll[]={0x00,0x00,0xf0,0x00,0x28,0xf0,0x50,0x00,0x00,0x00,};
uchar code tab[]={"*HANGZHOU TSINGTEK TECHNOLOGY CO...,LTD*"};
uchar code tab1[]={"*** HG320240 ***** HG320240 *******"};
uchar code tab2[]={"$$$$$ WEB: $$$$$"};
uchar code tab3[]={" EDITOR: MR QIN QQ:381198464"};
uchar code CGTAB[][32]={
/* 點陣:16x16
提取點陣方向:橫向(先上->下, 再左->右)
字節(jié)掉轉:否
字節(jié)方式:C語言 */
0x00,0x40,0x37,0x10,0x83,0x60,0x2F,0x08, // 清
0x13,0x22,0xE3,0x22,0x23,0x22,0x22,0x22,
0x40,0x48,0xFC,0x40,0xF8,0x40,0xFE,0x08,
0xFC,0x08,0xF8,0x08,0xF8,0x08,0x28,0x10,
0x00,0x40,0x20,0x20,0x00,0x0F,0xE0,0x21, // 達
0x21,0x22,0x22,0x24,0x28,0x50,0x8F,0x00,
0x80,0x80,0x80,0x80,0x88,0xFC,0x80,0x00,
0x40,0x20,0x10,0x18,0x08,0x06,0xFC,0x00,
0x01,0x21,0x11,0x09,0x09,0x01,0xFF,0x04, // 光
0x04,0x04,0x04,0x08,0x08,0x10,0x20,0x40,
0x00,0x08,0x0C,0x10,0x20,0x04,0xFE,0x40,
0x40,0x40,0x40,0x40,0x42,0x42,0x3E,0x00,
0x02,0x02,0x02,0x7F,0x42,0x42,0x7F,0x42, // 電
0x42,0x7F,0x42,0x02,0x02,0x02,0x01,0x00,
0x00,0x00,0x10,0xF8,0x10,0x10,0xF0,0x10,
0x10,0xF0,0x10,0x00,0x04,0x04,0xFC,0x00,
0x00,0x7F,0x44,0x47,0x4C,0x52,0x41,0x42, // 圖
0x46,0x49,0x70,0x46,0x41,0x40,0x7F,0x40,
0x04,0xFE,0x04,0xE4,0x44,0x84,0x04,0x84,
0x44,0x3C,0x94,0x04,0x04,0x84,0xFC,0x04,
0x00,0x7F,0x11,0x11,0x11,0x11,0x11,0xFF, // 形
0x11,0x11,0x11,0x11,0x21,0x21,0x41,0x01,
0x80,0xC4,0x0C,0x10,0x20,0x44,0x0C,0xD0,
0x20,0x42,0x06,0x08,0x10,0x20,0x40,0x80,
0x00,0x1F,0x10,0x10,0x1F,0x10,0x10,0x1F, // 顯
0x14,0x44,0x34,0x14,0x04,0x04,0xFF,0x00,
0x10,0xF8,0x10,0x10,0xF0,0x10,0x10,0xF0,
0x50,0x44,0x4C,0x50,0x40,0x44,0xFE,0x00,
0x00,0x3F,0x00,0x00,0x00,0x00,0xFF,0x01, // 示
0x01,0x09,0x19,0x21,0x41,0x01,0x05,0x02,
0x10,0xF8,0x00,0x00,0x00,0x04,0xFE,0x00,
0x00,0x20,0x18,0x0C,0x04,0x00,0x00,0x00,
0x11,0x11,0x1F,0x11,0xFD,0x13,0x32,0x3B, // 模
0x56,0x53,0x90,0x1F,0x10,0x10,0x11,0x16,
0x10,0x14,0xFE,0x10,0x18,0xFC,0x08,0xF8,
0x08,0xF8,0x40,0xFE,0x40,0xB0,0x0E,0x04,
0x10,0x10,0x10,0x10,0x13,0xFC,0x10,0x10, // 塊
0x10,0x17,0x1C,0xF1,0x41,0x02,0x04,0x08,
0x80,0x80,0x80,0x88,0xFC,0x88,0x88,0x88,
0x88,0xFE,0x80,0x40,0x20,0x10,0x0E,0x04,
};
/**延遲子程序***/
void delayus(uint us)
{
while(us--);
}
void Delay(uint t)
{
uint i,j;
for(i=0;i<t;i++)
for(j=0;j<10;j++);
}
/*讀數(shù)據(jù)代碼*/
uchar Cmdread()
{
uchar cmdcode;
LCD_BUS=0xff;
_CS=0;
A0=0;
_RD=0;
cmdcode=LCD_BUS;
_RD=1;
_WR=1;
_CS=1;
return cmdcode;
}
/***忙標志***/
void lcd_busy(void)
{
uchar busy;
do
{
busy =(Cmdread() & 0x40);
}while(busy);
}
/*****讀數(shù)據(jù)或參數(shù)*****/
uchar ReadData(void)
{
char address_data;
lcd_busy();
LCD_BUS=0xff;
A0 = 1;
_CS = 0;
_RD = 0;
address_data = LCD_BUS;
_RD = 1;
_CS = 1;
A0 = 1;
return address_data;
}
/*******寫指令代碼******/
void CmdWrite(uchar cmdcode)
{
_CS=0;
A0=1;
LCD_BUS=cmdcode; //寫入指令代碼
_RD=1;
_WR=0;
_WR=1;
_CS=1;
}
/******寫數(shù)據(jù)或參數(shù)*****/
void DataWrite(uchar wrdata)
{
lcd_busy();
_CS=0;
A0=0;
LCD_BUS=wrdata; //寫入數(shù)據(jù)或參數(shù)
_RD=1;
_WR=0;
_WR=1;
_CS=1;
}
/********整屏幕寫入 ******/
void FullScreenFill(uchar low,uchar high,uchar fill_data)
{
uchar i,j;
CmdWrite(0x46); //光標顯示位置設置
DataWrite(low);
DataWrite(high);
CmdWrite(0x42);
for(i=0;i<240;i++)
for(j=0;j<40;j++)
DataWrite(fill_data);
}
/****模塊初始化***/
void LCD_Initial()
{
unsigned int i;
CmdWrite(0x40); //系統(tǒng)設置
for(i=0;i<8;i++)
{DataWrite(systom[i]);};
CmdWrite(0x44); //顯示區(qū)域設置
for(i=0;i<10;i++)
{DataWrite(scroll[i]);};
CmdWrite(0x58); //顯示狀態(tài)設置,顯示總開關關閉
DataWrite(0x54); //打開各區(qū)顯示和關光標
CmdWrite(0x5b); //合成方式設置
DataWrite(0x00);
CmdWrite(0x5d); //光標形狀設置
DataWrite(0x07);
DataWrite(0x87);
CmdWrite(0x5c); //CGRAM 的起始地址為7800H
DataWrite(0x00);
DataWrite(0x78);
CmdWrite(0x5a); //點設定
DataWrite(0x00);
FullScreenFill(0x00,0x00,0x00); //清顯示1區(qū)
FullScreenFill(0x00,0x28,0x00); //清顯示二區(qū)
FullScreenFill(0x00,0x50,0x00); //清顯示三區(qū)
CmdWrite(0x59); //打開顯示總開關
}
/**********寫入字符串*********/
void PrintStr(uint x,uint y,uchar code *pstr)
{
unsigned int j;
j=40*y+x;
CmdWrite(0x4c);
CmdWrite(0x46);
DataWrite(j%256);
DataWrite(j/256);
CmdWrite(0x42);
while(*pstr!=0)
{
DataWrite(*pstr);
pstr++;
}}
/**寫入自定義字符**/
void cgramwrite()
{uint i,j;
CmdWrite(0x5c);
DataWrite(0x00);
DataWrite(0x10);
CmdWrite(0x46);
DataWrite(0x00);
DataWrite(0x14);//csr=0x1400;字摸地址80H
CmdWrite(0x4c);
CmdWrite(0x42);;
for(i=0;i<10;i++)
for(j=0;j<32;j++)
{DataWrite(CGTAB[i][j]);
}}
/**********文本方式下寫入漢字************/
void textwrite(uint x,uint y,uchar coder)
{
uint i,j;
cgramwrite();
i=40;
j=i*y+x;
CmdWrite(0x4f);
CmdWrite(0x46);
DataWrite(j%256);
DataWrite(j/256);
CmdWrite(0x42);
DataWrite(coder);
DataWrite(coder+1);
j++;
CmdWrite(0x46);
DataWrite(j%256);
DataWrite(j/256);
CmdWrite(0x42);
DataWrite(coder+2);
DataWrite(coder+3);
}
/**********圖形方式下寫入漢字************/
void mapwrite(uchar x,uchar y,uchar coder)
{
uint i,j,k;
CmdWrite(0x4c);
for(i=0;i<16;i++)
{
j=40*(y+i)+x+0x2800;
CmdWrite(0x46);
DataWrite(j%256);
DataWrite(j/256);
CmdWrite(0x42);
DataWrite(CGTAB[coder][i]);
k=40*(y+i)+x+1+0x2800;
CmdWrite(0x46);
DataWrite(k%256);
DataWrite(k/256);
CmdWrite(0x42);
DataWrite(CGTAB[coder][i+16]);
}}
/****圖形方式下寫入一串漢字***/
void writemaphz(uchar x,uchar y)
{
uint i;
for(i=0;i<10;i++)
{mapwrite(x,y,i);x=x+3;}
}
/**主程序**/
void main()
{
Delay(30);
LCD_Initial();
textwrite(7,12,0x80);
textwrite(10,12,0x84);
textwrite(13,12,0x88);
textwrite(16,12,0x8c);
textwrite(19,12,0x90);
textwrite(22,12,0x94);
textwrite(25,12,0x98);
textwrite(28,12,0x9c);
textwrite(31,12,0xe0);
textwrite(34,12,0xe4);
PrintStr(0,1,tab);
PrintStr(3,3,tab1);
PrintStr(2,5,tab2);
PrintStr(0,28,tab3);
writemaphz(4,200);
while(1);
}
杭州佳顯科技有限公司專注于液晶顯示屏,OLED顯示屏,低溫-40度液晶,國產(chǎn)低溫串口屏,加固低溫顯示屏,密封防潮顯示屏,TFT液晶,觸摸屏等, 歡迎致電 18069861507
詞條
詞條說明
OLED新型發(fā)光技術
目前,OLED市場已有一定的規(guī)模,大有乘東風之勢,全面實現(xiàn)顯示技術的新一輪變革。自2019年10月柔宇科技推出****款折疊屏手機,平板+手機的巧妙融合就在今年2月,OLED市場霸主,三星,也推出了折疊屏手機Galaxy Z Flip系列,引起了群眾對折疊屏的激烈討論,不論是吐槽它望而卻步的價格,笑稱翻蓋手機回光返照的設計,還是時尚便捷的外觀,都再一次讓折疊屏的應用成功進入了大眾視野,刷新了大眾對
lcd屏幕的優(yōu)勢
說到lcd顯示屏大家都不會陌生,它是當今顯示行業(yè)的主流,很多的終端產(chǎn)品都采用lcd顯示屏作為輸出設備。那小編今天就來細數(shù)一下它的優(yōu)勢。一、纖薄輕巧:大家都知道我們八十年代用的電視還是CRT顯示器,又大又笨重。隨著顯示行業(yè)的不斷發(fā)展,液晶顯示屏問世,通過不斷的改良換代成為今日我們所用的lcd顯示屏,它們纖薄輕巧,配到客戶的終端整機上不會占用太大的空間,滿足客戶對纖薄輕巧的要求。目前生產(chǎn)的顯示模組有些
工業(yè)液晶屏反應遲鈍怎么辦?
工業(yè)液晶屏在使用過程中,會出現(xiàn)一些故障,如不敏感的現(xiàn)象,那是什么原因會導致這種現(xiàn)象發(fā)生呢?讓我們學習一下如何較好地做好工業(yè)液晶屏的維護措施。如果觸摸屏反應緩慢,可能是觸摸屏系統(tǒng)陳舊,內部時鐘頻率太低,或者由于觸摸屏表面有水滴而無法移動,為了使觸摸屏恢復到快速響應,必須重新更換或升級系統(tǒng),或者用抹布擦拭觸摸屏表面。一般來說,這種現(xiàn)象對于多數(shù)觸摸屏來說是很常見的,但是應該注意維護它們。在詳細的操作使用
TFT與LCD的區(qū)別
TFT是LCD的一個變種,TFT,Thin Film Transistor薄膜晶體管,是有源矩陣類型液晶顯示器 AM-LCD 中的一種,TFT在液晶的背部設置特殊光管,可以“主動的”對屏幕上的各個獨立的像素進行控制,這也就是所謂的主動矩陣TFT(AcTIve Matrix TFT)的來歷,這樣可以大大地提高反應時間,一般TFT的反應時間比較快,約80ms,而STN則為200ms,如果要提高就會有閃
八方資源網(wǎng)提醒您:
1、本信息由八方資源網(wǎng)用戶發(fā)布,八方資源網(wǎng)不介入任何交易過程,請自行甄別其真實性及合法性;
2、跟進信息之前,請仔細核驗對方資質,所有預付定金或付款至個人賬戶的行為,均存在詐騙風險,請?zhí)岣呔瑁?