Saturday 20 May 2017

ILI9325 Initialization code (16bit interface)

Here is a initialization code for ILI9325, which is a 320x240 LCD driver. The code was tested on STM32F10X.

    LCD_W_REG(0x07, 0);     // DTE=0, D[1:0]=00, GON=0
    LCD_W_REG(0x10, 0);     // BT[2:0]=0, SAP=0
    LCD_W_REG(0x11, 0);     // VC[2:0]=0
    LCD_W_REG(0x12, 0);     // PON=0, VRH[3:0]=0
    LCD_W_REG(0x13, 0);     // VDV[4:0]=0
    LCD_W_REG(0x29, 0x0);     // VCM[5:0]=0
    
    // DELAY 50MS
    GUI_Delay(50);
    
    LCD_W_REG(0x10, 0x0090);    // BT[2:0]=0, AP[2:0}=001, APE=1, SAP=0
    LCD_W_REG(0x11, 0x0);         // DC1[2:0]=000, DC0[2:0]=000
    LCD_W_REG(0x12, 0x0011);    // VCIRE=0, PON=1, VRH[3:0}=0001
    
    // DELAY 80MS
    GUI_Delay(80);
    LCD_W_REG(0x07, 0x0133);    // BASEE=1, DTE=1, GON=1, D[1:0]=11
    LCD_W_REG(0x10, 0x1090);    // SAP=1
    LCD_W_REG(0x2B, 0x000e);    // frame rate 112hz
    LCD_W_REG(0x0060, 0xA700); // Gate Scan Line
    LCD_W_REG(0x0061, 0x0001); // REV=1    

4 comments:

  1. Thank you for posting this. I tried the same initialization code and all I get is a white screen. I wanted to make a 10 lines of black dots on the screen. After I did the above initialization, I put the black 0x0000 into the GRAM. But all I have on the screen is white color. Could you give a hint on what could be wrong here?.

    ReplyDelete
    Replies
    1. Hi, thanks for commenting. Sorry I'm not very sure what was wrong there. I was using the emWin GUI system, all I need to do was initializing the LCD and the use the APIs to display what I need to display. So I'm sorry I can't help.

      Delete
  2. Can you share any code with printing examles for ili9325?
    Thanks anyway

    ReplyDelete
    Replies
    1. I'm not very sure what do you mean by "printing"? Do you mean to print on ILI9325 screen? Sorry I don't have, I let emWin to do these lower level jobs and I send command to emWin only.

      Delete