// EXIT IDLE mode Setting
Set_LCD_8B_REG(0x18,0x36); //I/P_RADJ,N/P_RADJ, Normal mode 75HZ
Set_LCD_8B_REG(0x2F,0x11); //Normal mode line inversion 11 or frame inversion 00
//Set_LCD_8B_REG(0x01,0x00); //IDLE='0', EXIT IDLE mode
//Driving ability Setting
Set_LCD_8B_REG(0xEA,0x00); //PTBA[15:8]
Set_LCD_8B_REG(0xEB,0x20); //PTBA[7:0]
Set_LCD_8B_REG(0xEC,0x0C); //STBA[15:8]
Set_LCD_8B_REG(0xED,0xC4); //STBA[7:0]
Set_LCD_8B_REG(0xE8,0x40); //OPON[7:0]
Set_LCD_8B_REG(0xE9,0x38); //OPON1[7:0]
Set_LCD_8B_REG(0xF1,0x01); //OTPS1B
Set_LCD_8B_REG(0xF2,0x10); //GEN
Set_LCD_8B_REG(0x27,0xA3); //
//Gamma 2.4 Setting
Set_LCD_8B_REG(0x40,0x01); //
Set_LCD_8B_REG(0x41,0x00); //
Set_LCD_8B_REG(0x42,0x00); //
Set_LCD_8B_REG(0x43,0x10); //
Set_LCD_8B_REG(0x44,0x0E); //
Set_LCD_8B_REG(0x45,0x24); //
Set_LCD_8B_REG(0x46,0x04); //
Set_LCD_8B_REG(0x47,0x50); //
Set_LCD_8B_REG(0x48,0x02); //
Set_LCD_8B_REG(0x49,0x13); //
Set_LCD_8B_REG(0x4A,0x19); //
Set_LCD_8B_REG(0x4B,0x19); //
Set_LCD_8B_REG(0x4C,0x16); //
Set_LCD_8B_REG(0x50,0x1B); //
Set_LCD_8B_REG(0x51,0x31); //
Set_LCD_8B_REG(0x52,0x2F); //
Set_LCD_8B_REG(0x53,0x3F); //
Set_LCD_8B_REG(0x54,0x3F); //
Set_LCD_8B_REG(0x55,0x3E); //
Set_LCD_8B_REG(0x56,0x2F); //
Set_LCD_8B_REG(0x57,0x7B); //
Set_LCD_8B_REG(0x58,0x09); //
Set_LCD_8B_REG(0x59,0x06); //
Set_LCD_8B_REG(0x5A,0x06); //
Set_LCD_8B_REG(0x5B,0x0C); //
Set_LCD_8B_REG(0x5C,0x1D); //
Set_LCD_8B_REG(0x5D,0xCC); //
//power setting
Set_LCD_8B_REG(0x1B,0x1b); //VRH=4.8V
Set_LCD_8B_REG(0x1A,0x01); //BT (VGH~15V,VGL~-10V,DDVDH~5V)
Set_LCD_8B_REG(0x24,0x55); //VMH(VCOM High voltage ~3.2V)2f
Set_LCD_8B_REG(0x25,0x53); //VML(VCOM Low voltage -1.2V)
//****VCOM offset**///
Set_LCD_8B_REG(0x23,0x88); //for Flicker adjust //can reload from OTP
//Power on Setting
Set_LCD_8B_REG(0x18,0x36); //I/P_RADJ,N/P_RADJ, Normal mode 50Hz
Set_LCD_8B_REG(0x19,0x01); //OSC_EN='1', start Osc
Set_LCD_8B_REG(0x01,0x00); //DP_STB='0', out deep sleep
Set_LCD_8B_REG(0x1F,0x88);// GAS=1, VOMG=00, PON=0, DK=1, XDK=0, DVDH_TRI=0, STB=0
delay(5);
Set_LCD_8B_REG(0x1F,0x80);// GAS=1, VOMG=00, PON=0, DK=0, XDK=0, DVDH_TRI=0, STB=0
delay(5);
Set_LCD_8B_REG(0x1F,0x90);// GAS=1, VOMG=00, PON=1, DK=0, XDK=0, DVDH_TRI=0, STB=0
delay(5);
Set_LCD_8B_REG(0x1F,0xD0);// GAS=1, VOMG=10, PON=1, DK=0, XDK=0, DDVDH_TRI=0, STB=0
delay(5);
//262k/65k color selection
Set_LCD_8B_REG(0x17,0x05); //default 0x06 262k color // 0x05 65k color
//SET PANEL
Set_LCD_8B_REG(0x36,0x02); //SS_P, GS_P,REV_P,BGR_P
Set_LCD_8B_REG(0x01,0x02);
//Display ON Setting
Set_LCD_8B_REG(0x28,0x38); //GON=1, DTE=1, D=1000
delay(40);
Set_LCD_8B_REG(0x28,0x3C); //GON=1, DTE=1, D=1100
//Set GRAM Area
Set_LCD_8B_REG(0x02,0x00);
Set_LCD_8B_REG(0x03,0x00); //Column Start
Set_LCD_8B_REG(0x04,0x00);
Set_LCD_8B_REG(0x05,0xEF); //Column End
Set_LCD_8B_REG(0x06,0x00);
Set_LCD_8B_REG(0x07,0x00); //Row Start
Set_LCD_8B_REG(0x08,0x01);
Set_LCD_8B_REG(0x09,0x3F); //Row End
write_register(0x22); //Start GRAM write