深圳市圣邦达电子有限公司
电话:086-0755-83723989 传真:086-0755-61351350
网 站 www.sbdsemi.cn EMAIL: yangbin7575@163.com
联系人:杨 生 13543266942 13642365547
1.4.1. LPL 2.2” initial code
void ILI9320_LPL22_Initial(void)
{
// VCI=2.8V
//************* Reset LCD Driver ****************//
LCD_nRESET = 1;
delayms(1); // Delay 1ms
LCD_nRESET = 0;
delayms(10); // Delay 10ms
LCD_nRESET = 1;
delayms(50); // Delay 50 ms
//************* Start Initial Sequence **********//
LCD_CtrlWrite_ILI9320(0x00E5, 0x8000);
LCD_CtrlWrite_ILI9320(0x0000, 0x0001);
LCD_CtrlWrite_ILI9320(0x0001, 0x0100);
LCD_CtrlWrite_ILI9320(0x0002, 0x0700);
LCD_CtrlWrite_ILI9320(0x0003, 0x1030);
LCD_CtrlWrite_ILI9320(0x0004, 0x0000);
// Set the internal vcore voltage
// Start internal OSC.
// set SS and SM bit
// set 1 line inversion
// set GRAM write direction and BGR=1.
// Resize register
LCD_CtrlWrite_ILI9320(0x0008, 0x0202);
LCD_CtrlWrite_ILI9320(0x0009, 0x0000);
LCD_CtrlWrite_ILI9320(0x000A, 0x0000);
LCD_CtrlWrite_ILI9320(0x000C, 0x0000);
LCD_CtrlWrite_ILI9320(0x000D, 0x0000);
LCD_CtrlWrite_ILI9320(0x000F, 0x0000);
// set the back porch and front porch
// set non-display area refresh cycle ISC[3:0]
// FMARK function
// RGB interface setting
// Frame marker Position
// RGB interface polarity
//*************Power On sequence ****************//
LCD_CtrlWrite_ILI9320(0x0010, 0x0000);
LCD_CtrlWrite_ILI9320(0x0011, 0x0007);
LCD_CtrlWrite_ILI9320(0x0012, 0x0000);
LCD_CtrlWrite_ILI9320(0x0013, 0x0000);
delayms(200);
// SAP, BT[3:0], AP, DSTB, SLP, STB
// DC1[2:0], DC0[2:0], VC[2:0]
// VREG1OUT voltage
// VDV[4:0] for VCOM amplitude
// Dis-charge capacitor power voltage
LCD_CtrlWrite_ILI9320(0x0010, 0x17B0);
LCD_CtrlWrite_ILI9320(0x0011, 0x0137);
// SAP, BT[3:0], AP, DSTB, SLP, STB
// DC1[2:0], DC0[2:0], VC[2:0]
delayms(50);
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0012, 0x013B);
// VREG1OUT voltage
delayms(50);
// Delay 50ms
LCD_CtrlWrite_ILI9320(0x0013, 0x0E00);
LCD_CtrlWrite_ILI9320(0x0029, 0x000F);
delayms(50);
// VDV[4:0] for VCOM amplitude
// VCM[4:0] for VCOMH
LCD_CtrlWrite_ILI9320(0x0020, 0x0000);
LCD_CtrlWrite_ILI9320(0x0021, 0x0000);
// GRAM horizontal Address
// GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
LCD_CtrlWrite_ILI9320(0x0030, 0x0307);
LCD_CtrlWrite_ILI9320(0x0031, 0x0507);
LCD_CtrlWrite_ILI9320(0x0032, 0x0500);
LCD_CtrlWrite_ILI9320(0x0035, 0x0304);
LCD_CtrlWrite_ILI9320(0x0036, 0x0007);
LCD_CtrlWrite_ILI9320(0x0037, 0x0707);
LCD_CtrlWrite_ILI9320(0x0038, 0x0007);
LCD_CtrlWrite_ILI9320(0x0039, 0x0007);
LCD_CtrlWrite_ILI9320(0x003C, 0x0600);
圣邦达电子有限公司 电话 0755-83723989 81753210 传真 0755-61351350 www.sbdsemi.cn
Page 18 of 34
V0.9