第一次使用Sitronix的彩色LCD driver,开发故事书,电子书及数码相框,遇到了以下问题,请大虾们指教:
环境:使用的是LCD厂家成品LCD(ST7669),8bit parallet接口 1)初始化程序调用资料上的(Initial_ST7669();56k颜色),基本没改,改了对比度参数,应该控制到了,很多命令的响应正确。 2)然后希望得到红绿蓝条纹,程序如下,有条纹,颜色错 void main() { ... Initial_ST7669(); ...
WP7(LC,0x2c); j=0xf800; for (i=0;i<0x1000;i++) { WP7(LD,j>>8); WP7(LD,j&0xff); }
j=0xffff; for (i=0;i<0x1000;i++) { WP7(LD,j>>8); WP7(LD,j&0xff); } j=0x7e0; for (i=0;i<0x1000;i++) { WP7(LD,j>>8); WP7(LD,j&0xff); }
j=0xffff; for (i=0;i<0x1000;i++) { WP7(LD,j>>8); WP7(LD,j&0xff); } j=0x1f; for (i=0;i<0x1000;i++) { WP7(LD,j>>8); WP7(LD,j&0xff); }
WP7(LC,0x29); while(1); } 3)测试读写数据: ... Initial_ST7669(); ... WP7(LC,0x2c); for (i=0;i<0xa000;i++) WP7(LD,0xff); WP7(LC,0x2e); for (i=0;i<0x100;i++) { j=RFlashByte(CS3Offset+1);//这个是根据我系统需要的一个外部存储器读子程序,地址设置肯定没错 TxHex(j); } //通过232得到数据:0x00,0xfc,0xfc,0xfc..... for (i=0;i<0xa000;i++) WP7(LD,0x00); WP7(LC,0x2e); for (i=0;i<0x100;i++) { j=RFlashByte(CS3Offset+1);//这个是根据我系统需要的一个外部存储器读子程序,地址设置肯定没错 TxHex(j); } //通过232得到数据:00 FC 1C C0 FC 1C C0 FC 1C C0 ... 3)显示RAM全部写0时,得到的好像是黑屏,全写0xff时,得到的是反而是白屏,因为颜色控制一直没调通 4)初始化程序 void Initial_ST7669() { //*****disable autoread + Manual read once Write7669(LcdCmd,0xd7); //Auto Load Set Write7669(LcdDat,0xdf); //Auto Load Disable
Write7669(LcdCmd,0xE0); //EE Read/write mode Write7669(LcdDat,0x00); //Set read mode
Delay1ms(10); Write7669(LcdCmd,0xE3); //Read active Delay1ms(20); Write7669(LcdCmd,0xE1); //Cancel control //*****Sleep OUT Write7669(LcdCmd,0x11); //Sleep Out Write7669(LcdCmd,0x28); //Display OFF Delay1ms(50); //*****Vop setting Write7669(LcdCmd,0xC0); //Set Vop by initial Module Write7669(LcdDat,0x04); //Vop = 14V Write7669(LcdDat,0x01); //base on Module //*****Set Register Write7669(LcdCmd,0xC3); //Bias select Write7669(LcdDat,0x05); //1/9 Bias,base on Module Write7669(LcdCmd,0xC4); //Setting Booster times Write7669(LcdDat,0x07); //Booster X 8 Write7669(LcdCmd,0xC5); //Booster eff Write7669(LcdDat,0x21); //BE = 0x01 (Level 2) Write7669(LcdCmd,0xCB); //Vg with booster x2 control Write7669(LcdDat,0x01); //Vg from Vdd2 Write7669(LcdCmd,0xCC); //ID1 = 00 Write7669(LcdDat,0x00); // Write7669(LcdCmd,0xCE); //ID3 = 00 Write7669(LcdDat,0x00);
Write7669(LcdCmd,0xB7); //COM/SEG Direction for glass // Write7669(LcdDat,0x48); //Setting by LCD module
Write7669(LcdCmd,0xD0); //Analog circuit setting Write7669(LcdDat,0x1D); //
Write7669(LcdCmd,0xB5); //NLine Write7669(LcdDat,0x8D); //NonRST,14line inversion
Write7669(LcdCmd,0xD7); //Auto read Set Write7669(LcdDat,0x9F); //OTP Disable
Write7669(LcdCmd,0xB4); //PTL Mode Select Write7669(LcdDat,0x18); //PTLMOD à Normal Mode
Write7669(LcdCmd,0x38); //Color mode = 65k
Write7669(LcdCmd,0x3A); //Color mode = 65k Write7669(LcdDat,0x05); //
Write7669(LcdCmd,0x25); //Contrast Write7669(LcdCmd,0x60);
Write7669(LcdCmd,0x36); //Memory Access Control // //Write7669(LcdDat,0xC8); //Setting by LCD module Write7669(LcdDat,0x00); //Setting by LCD module
Write7669(LcdCmd,0xB0); //Duty = 160 duty Write7669(LcdDat,0x9F);
Write7669(LcdCmd,0x20); //Display Inversion OFF //Write7669(LcdCmd,0x21); //Display Inversion ON
Write7669(LcdCmd,0xF7); //command for temp sensitivity. Write7669(LcdCmd,0x06); // Write7669(LcdCmd,0x2A); //COL// Write7669(LcdDat,0x00); //0~127 Write7669(LcdDat,0x00); Write7669(LcdDat,0x00); Write7669(LcdDat,0x7F); Write7669(LcdCmd,0x2B); //Page // Write7669(LcdDat,0x00); //0~159 Write7669(LcdDat,0x00); Write7669(LcdDat,0x00); Write7669(LcdDat,0x9F); }
|