STM8驅動 STVD寫的程式,LCD160160 (UC1698U),試了兩個晚上了。一直都是顯示雪花,雪花,雪花。完全搞不懂這款LCD的驅動流程,拜托各位大佬指導指導。
小弟積分少,各位大佬體諒體諒


。#include"LCD160160.h"
unsigned int l;
void L_Delay(unsigned int t)
{
while(t--);
}
void LCD160160_Init()
{
L_Delay(50);
RES=1;
L_Delay(200);
RES=0;
L_Delay(200);
RES=1;
L_Delay(200);
Write_Com(0xe2); // 軟體復位,控制暫存器值被復位為預設值
L_Delay(200); //delay 200ms
L_Delay(200); //delay 200ms
Write_Com(0x25); //溫度補償設定 TC1TC0 01=-0.05%
Write_Com(0x2b); //PC0=1 LCD負載13nF≤LCD≤22nF PC1=1 啟動內部升壓 為10*DC-DC產生所需的VLCD。開顯示后不得更改PC1值。
Write_Com(0xa6); //A6關閉負性顯示設定 A7打開負性顯示
Write_Com(0xa4); //A4關閉全顯功能 a5打開全顯功能
Write_Com(0x81); //設定LCD對比度
Write_Com(0xd1); //對比的電壓值0-255
Write_Com(0xE9); //該指令設定了 LCD 驅動的偏壓比。
Write_Com(0xc0); //LCD 映像設定 1 1 0 0 0 MY MX LC0 C0-C7
Write_Com(0xa1); //設定幀頻率 101000 LC4 LC3 A0-A3
Write_Com(0xd1); //顯示資料格式設定1101000LC5 D0-D1
Write_Com(0xd5); //1 1 0 1 0 1 LC7 LC6 D5-D6
Write_Com(0xc8); Write_Com(0x00); //11001000 C8+xxxNIV4:NIV0 00H-1Fh
Write_Com(0xd8); //區域顯示控制設定 84H / 85H
Write_Com(0xad); //10101 DC4 DC3 DC2 A8H-AFH 10101101
Write_Com(0xf4); Write_Com(0x25); //操作視窗左邊界(起始列地址)設定
Write_Com(0xf5); Write_Com(0x00); //操作視窗上邊界(起始行地址)設定
Write_Com(0xf6); Write_Com(0x5A); //操作視窗右邊界(結束列地址)設定
Write_Com(0xf7); Write_Com(0x9f); //操作視窗下邊界(結束行地址)設定
Write_Com(0xf8); //視窗操作模式設定
//Write_Com(0x05); Write_Com(0x12);
//Write_Com(0x60); Write_Com(0x70);
L_Delay(9000);
L_Delay(9000);
for(l=0;l<160*28;l++)
{
Write_Data(0x00); //寫入像素1,寫入像素2
Write_Data(0x00); //寫入像素3,寫入像素4
Write_Data(0x00); //寫入像素5,寫入像素6
}
}
void Write_Com(unsigned int Command)
{
CS=0;
CD=0;
WR=0;
RD=1;
L_Delay(800);
Lcd_Bus(Command);
WR=1;
CS=1;
}
void Write_Data(unsigned int Ddata)
{
CS=0; //chip select
CD=1; //H:Data L:Command
WR=0;
RD=1; //Date rede
L_Delay(800);
Lcd_Bus(Ddata);
WR=1; //Date write
CS=1;
}
uj5u.com熱心網友回復:
我是參照UC1698u-中文資料手冊寫的。也不確定這樣的驅動方式對不對。uj5u.com熱心網友回復:
很尷尬,問題找到了一些,原來是單片機引腳有兩個不能輸出高電平 是有true od的只能輸出低,不能輸出高,輸入態也沒有上拉電阻。。。轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/71017.html
標籤:單片機/工控
