本帖最后由 lophost 于 2017-1-3 16:47 编辑
void GUI_LCDInit(void)
{
RST_CRL;
s_WaitNms(30);
RST_SET;
CS_SET;
WR_SET;
RD_SET;
s_CmdWrite(0x88);
s_DataWrite(0x0b);
s_Delay(10000);
s_CmdWrite(0x89);
s_DataWrite(0x02);
s_Delay(10000);
s_CmdWrite(0x10); //SYSR bit[4:3]=00 256 color bit[2:1]= 00 8bit MPU interface
s_DataWrite(0x0C); // if 8bit MCU interface and 65k color display
s_Delay(10000);
//============== Display Window 640x480 ==================
s_CmdWrite(0x04); //PCLK inverse
s_DataWrite(0x01);
s_Delay(10000);
//Horizontal set
s_CmdWrite(0x14);//HDWR//Horizontal Display Width Setting Bit[6:0]
s_DataWrite(0x4F);//Horizontal display width(pixels) = (HDWR + 1)*8
s_CmdWrite(0x15); //Horizontal Non-Display Period Fine Tuning Option Register (HNDFTR)
s_DataWrite(0x05);//Horizontal Non-Display Period Fine Tuning(HNDFT) [3:0]
s_CmdWrite(0x16);//HNDR//Horizontal Non-Display Period Bit[4:0]
s_DataWrite(0x0f);//Horizontal Non-Display Period (pixels) = (HNDR + 1)*8
s_CmdWrite(0x17);//HSTR//HSYNC Start Position[4:0]
s_DataWrite(0x01);//HSYNC Start Position(PCLK) = (HSTR + 1)*8
s_CmdWrite(0x18); //HPWR//HSYNC Polarity ,The period width of HSYNC.
s_DataWrite(0x00);//HSYNC Width [4:0] HSYNC Pulse width(PCLK) = (HPWR + 1)*8
//Vertical set
s_CmdWrite(0x19); //VDHR0 //Vertical Display Height Bit [7:0]
s_DataWrite(0xdf);//Vertical pixels = VDHR + 1
s_CmdWrite(0x1A);//VDHR1 //Vertical Display Height Bit [8]
s_DataWrite(0x01);//Vertical pixels = VDHR + 1
s_CmdWrite(0x1B);//VNDR0 //Vertical Non-Display Period Bit [7:0]
s_DataWrite(0x0A);//Vertical Non-Display area = (VNDR + 1)
s_CmdWrite(0x1C);//VNDR1 //Vertical Non-Display Period Bit [8]
s_DataWrite(0x00);//Vertical Non-Display area = (VNDR + 1)
s_CmdWrite(0x1D);//VSTR0 //VSYNC Start Position[7:0]
s_DataWrite(0x0E);//VSYNC Start Position(PCLK) = (VSTR + 1)
s_CmdWrite(0x1E);//VSTR1 //VSYNC Start Position[8]
s_DataWrite(0x00);//VSYNC Start Position(PCLK) = (VSTR + 1)
s_CmdWrite(0x1F);//VPWR //VSYNC Polarity ,VSYNC Pulse Width[6:0]
s_DataWrite(0x01);//VSYNC Pulse Width(PCLK) = (VPWR + 1)
//Active window set
//setting active window X
s_CmdWrite(0x30); //Horizontal Start Point 0 of Active Window (HSAW0)
s_DataWrite(0x00); //Horizontal Start Point of Active Window [7:0]
s_CmdWrite(0x31); //Horizontal Start Point 1 of Active Window (HSAW1)
s_DataWrite(0x00); //Horizontal Start Point of Active Window [9:8]
s_CmdWrite(0x34); //Horizontal End Point 0 of Active Window (HEAW0)
s_DataWrite(0x7f); //Horizontal End Point of Active Window [7:0]
s_CmdWrite(0x35); //Horizontal End Point 1 of Active Window (HEAW1)
s_DataWrite(0x02); //Horizontal End Point of Active Window [9:8]
//setting active window Y
s_CmdWrite(0x32); //Vertical Start Point 0 of Active Window (VSAW0)
s_DataWrite(0x00); //Vertical Start Point of Active Window [7:0]
s_CmdWrite(0x33); //Vertical Start Point 1 of Active Window (VSAW1)
s_DataWrite(0x00); //Vertical Start Point of Active Window [8]
s_CmdWrite(0x36); //Vertical End Point of Active Window 0 (VEAW0)
s_DataWrite(0xdf); //Vertical End Point of Active Window [7:0]
s_CmdWrite(0x37); //Vertical End Point of Active Window 1 (VEAW1)
s_DataWrite(0x01); //Vertical End Point of Active Window [8]
/*setting RA8875 display on*/
s_CmdWrite(0x01); //
s_DataWrite(0x80); //
s_Delay(10000);
Active_Window(0,639,0,479); }
如上初始化之后,屏幕花屏,哪位知道问题出在哪里,指点下,多谢
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>