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