• Welcome to Andy's Workshop Forums. Please login or sign up.
May 18, 2024, 12:15:09 am


SMF - Just Installed!

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - lampii

General discussion / Help configuring an IL9325 panel
December 04, 2016, 09:44:47 am

I am trying to run the Waveshare 3.2" LCD (IL9325) panel using an stm32F429. I've managed to drive the 16bit bus along with the control lines correctly since I can read out the panels ID from the first register. I have been having a very hard time trying to get the panels drawing pictures, but I am not sure what I am doing wrong. I can go from a white screen, to a bit of a darker background after running my initialization procedure but any attempts to draw have no effect. I was hoping if someone here had any insight on what to look at for my symptoms or if they could take a look at my register settings to see if I am doing anything blatantly wrong.

Any help would be greatly appreciated. And Andy, thank you so much for your site. It has proved to be a very useful tool for learning.

void IL9325Init()

    WriteData(0x0000, 0x0001); /* Start internal OSC. */
    WriteData(0x0001, (0<<10)|(1<<8)); /* Set SS and SM bit */
    WriteData(0x0002, 0x0700); /* Set 1 line inversion */
    WriteData(0x0003, (1<<12)|(1<<5)|(1<<4)|(0<<3)); /* Set GRAM write direction and BGR=1. */
    WriteData(0x0004, 0x0000); /* Resize register */
    WriteData(0x0008, 0x0207); /* Set the back porch and front porch */
    WriteData(0x0009, 0x0000); /* Set non-display area refresh cycle ISC[3:0] */
    WriteData(0x000A, 0x0000); /* FMARK function */
    WriteData(0x000C, 0x0001); /* RGB interface setting */
    WriteData(0x000D, 0x0000); /* Frame marker Position */
    WriteData(0x000F, 0x0000); /* RGB interface polarity */

    /* Power On sequence -----------------------------------------------------*/
    WriteData(0x0010, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
    WriteData(0x0011, 0x0007); /* DC1[2:0], DC0[2:0], VC[2:0] */
    WriteData(0x0012, 0x0000); /* VREG1OUT voltage */
    WriteData(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
    delay_ms(2000);                      /* Dis-charge capacitor power voltage (200ms) */

WriteData(0x0010,0x0AC8); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
WriteData(0x0011,0x223);//0x0227);/* DC1[2:0], DC0[2:0], VC[2:0] */
    delay_ms(500);                       /* Delay 50 ms */
WriteData(0x0012,  0x001F);


    /* Delay 50 ms */
    WriteData(0x0013, 0x1900);/* VDV[4:0] for VCOM amplitude */
    WriteData(0x0029,0x003E);/* VCM[4:0] for VCOMH */
    WriteData(0x002B,0x000E);/* Set Frame Rate */

    delay_ms(500);                       /* Delay 50 ms */
    WriteData(0x0020, 0x0000); /* GRAM horizontal Address */
    WriteData(0x0021, 0x0000); /* GRAM Vertical Address */
    delay_ms(500);                       /* Delay 50 ms */

    /* Adjust the Gamma Curve (ILI9325)---------------------------------------*/

    delay_ms(500);                       /* Delay 50 ms */

    /* Set GRAM area ---------------------------------------------------------*/
    WriteData(0x0050, 0x0000); /* Horizontal GRAM Start Address */
    WriteData(0x0051, 0x00EF); /* Horizontal GRAM End Address */
    WriteData(0x0052, 0x0000); /* Vertical GRAM Start Address */
    WriteData(0x0053, 0x013F); /* Vertical GRAM End Address */

    WriteData(0x0060,  0xA700); /* Gate Scan Line(GS=1, scan direction is G320~G1) */
    WriteData(0x0061,  0x0001); /* NDL,VLE, REV */
    WriteData(0x006A, 0x0000); /* set scrolling line */

    /* Partial Display Control -----------------------------------------------*/
    WriteData(0x0080, 0x0000);
    WriteData(0x0081, 0x0000);
    WriteData(0x0082, 0x0000);
    WriteData(0x0083, 0x0000);
    WriteData(0x0084, 0x0000);
    WriteData(0x0085, 0x0000);

    /* Panel Control ---------------------------------------------------------*/
    WriteData(0x0090, 0x0010);
    WriteData(0x0092, 0x0600);
    WriteData(0x0093, 0x0003);
    WriteData(0x0095, 0x0110);
    WriteData(0x0097, 0x0000);
    WriteData(0x0098, 0x0000);

    /* Set GRAM write direction and BGR = 1 */
    /* I/D=00 (Horizontal : increment, Vertical : decrement) */
    /* AM=1 (address is updated in vertical writing direction) */
    //WriteData(0x0003, 0x1018);
    WriteData(0x0007, 0x0133); /* 262K color and display ON */