Author Topic: New LCD Instructions for 9331 LCD  (Read 2406 times)

kswildside

  • Guest
New LCD Instructions for 9331 LCD
« on: March 25, 2010, 01:23:17 am »
Here are the programming instructions for the 9331 LCD

1.void Initial_ILI9331_Hydis28(void)
2.{
3.//  RESET=0;
4.//  Delayms(5);
5.//  RESET=1;
6.//  Delayms(10);
7.
8.    WriteRegister(0xe7,0x1014);  // Set internal timing
9.    WriteRegister(0x01,0x0100);  // set SS and SM bit
10.    WriteRegister(0x02,0x0200);  // set 1 line inversion
11.    WriteRegister(0x03,0x1030);  // set GRAM write direction and BGR=1.
12.
13.    WriteRegister(0x08,0x0202);  // set the back porch and front porch
14.    WriteRegister(0x09,0x0000);  // set non-display area refresh cycle ISC[3:0]
15.    WriteRegister(0x0A,0x0000);  // FMARK function
16.    WriteRegister(0x0C,0x0000);  // RGB interface setting
17.    WriteRegister(0x0D,0x0000);  // Frame marker Position
18.    WriteRegister(0x0F,0x0000);  // RGB interface polarity
19.
20.//  Power On Sequence //
21.    WriteRegister(0x10,0x0000);  // SAP, BT[3:0], AP, DSTB, SLP, STB
22.    WriteRegister(0x11,0x0007);  // DC1[2:0], DC0[2:0], VC[2:0]
23.    WriteRegister(0x12,0x0000);  // VREG1OUT voltage
24.    WriteRegister(0x13,0x0000);  // VDV[4:0] for VCOM amplitude
25.    Delayms(100);
26.
27.    WriteRegister(0x10,0x1690);  // SAP, BT[3:0], AP, DSTB, SLP, STB
28.    WriteRegister(0x11,0x0227);  // DC1[2:0], DC0[2:0], VC[2:0]
29.    Delayms(50);
30.    WriteRegister(0x12,0x000c);
31.    Delayms(50);
32.    WriteRegister(0x13,0x0800);   //0X1A
33.    WriteRegister(0x29,0x0011);
34.    WriteRegister(0x2b,0x000b);
35.    Delayms(50);
36.                         
37.
38.//Adjust the Gamma curve//
39.    WriteRegister(0x30,0x0000);
40.    WriteRegister(0x31,0x0106);
41.    WriteRegister(0x32,0x0000);
42.    WriteRegister(0x35,0x0204);
43.    WriteRegister(0x36,0x160a);
44.    WriteRegister(0x37,0x0707);
45.    WriteRegister(0x38,0x0106);
46.    WriteRegister(0x39,0x0706);
47.    WriteRegister(0x3c,0x0402);
48.    WriteRegister(0x3d,0x0c0f);
49.
50.//--------- set GRAM area -----------   
51.    WriteRegister(0x50,0x0000);  //Horizontal RAM Address Position start
52.    WriteRegister(0x51,0x00ef);  //Horizontal RAM Address Position end
53.    WriteRegister(0x52,0x0000);  //Vertical RAM Address Position start
54.    WriteRegister(0x53,0x013f);  //Vertical RAM Address Position end       
55.    WriteRegister(0x20,0x0000);  //Set horizontal address
56.    WriteRegister(0x21,0x0000);  //Set vertical address
57.
58.    WriteRegister(0x60,0x2700);
59.    WriteRegister(0x61,0x0001);
60.    WriteRegister(0x6a,0x0000);
61.   
62.   // Partial display control //
63.    WriteRegister(0x80,0x0000);
64.    WriteRegister(0x81,0x0000);
65.    WriteRegister(0x82,0x0000);
66.    WriteRegister(0x83,0x0000);
67.    WriteRegister(0x84,0x0000);
68.    WriteRegister(0x85,0x0000);
69.
70.// Panel control //
71.    WriteRegister(0x90,0x0010);
72.    WriteRegister(0x92,0x0600);
73.
74.    WriteRegister(0x07,0x0133);  //display on
75.   
76.    // write display data
77.   // WriteRegister(0x20,0x0000);  //Set horizontal address
78.   // WriteRegister(0x21,0x0000);  //Set vertical address
79.   // WriteIndex(0x00,0x22);  //write data to GRAM
80.}
81.
82.
83.
84.    void LCD_ExitSleep_ILI9331()
85.  {
86.    WriteRegister(0x10,0x0080);  //
87.    WriteRegister(0x11,0x0000);  //
88.    WriteRegister(0x12,0x0000);  //
89.    WriteRegister(0x13,0x0000);  //
90.    Delayms(200);
91.    WriteRegister(0x10,0x1690);  //
92.    WriteRegister(0x11,0x0227);  //
93.    Delayms(50);
94.    WriteRegister(0x12,0x000C);  //
95.    Delayms(50);
96.    WriteRegister(0x13,0x0800);  //
97.    WriteRegister(0x29,0x0011);  //
98.    Delayms(50);
99.    WriteRegister(0x07,0x0133);  //
100. 
101. 
102.  }
103.
104.  void LCD_EnterSleep_ILI9331()
105.  {
106.    WriteRegister(0x07,0x0131);  //
107.    Delayms(10);
108.    WriteRegister(0x07,0x0130);  //
109.    Delayms(10);
110.    WriteRegister(0x07,0x0000);  // display off
111.   //power off sequence
112.    WriteRegister(0x10,0x0080);  //
113.    WriteRegister(0x11,0x0000);  //
114.    WriteRegister(0x12,0x0000);  //
115.    WriteRegister(0x13,0x0000);  //
116.    Delayms(200);
117.    WriteRegister(0x10,0x0082);  //
118. 
119.  }

RodrigoCard

  • *
  • Posts: 314
    • Mac Joystick Apps
Re: New LCD Instructions for 9331 LCD
« Reply #1 on: April 04, 2010, 04:09:26 am »
Just a little question, what could these new instructions benefit?

kswildside

  • Guest
Re: New LCD Instructions for 9331 LCD
« Reply #2 on: April 04, 2010, 05:35:46 am »
No clue I get info I give info not a dev

flatmush

  • *
  • Posts: 284
Re: New LCD Instructions for 9331 LCD
« Reply #3 on: April 04, 2010, 01:00:51 pm »
These commands show us how to initialize the display using the i2s interface, it's pretty useful if you wanna do hardware stuff.

 

Post a new topic
Post a new topic