0
\$\begingroup\$

Guys I have an issue initializing ST7789S LCD driver for RGB connection.

IM0: 0; IM1: 1; IM2: 1; DOT clock: 7MHz.
Also this is my LTDC configuration:
enter image description here

Here is my code:

void ST7789_Init(void)
{
    ST7789_CS_Set();
     HAL_Delay(20);
     ST7789_CS_Clr();
     HAL_Delay(20);

    ST7789_RST_Set();
    HAL_Delay(200);
    ST7789_RST_Clr();
    HAL_Delay(200);
    ST7789_RST_Set();
    HAL_Delay(200);

    /*FRAME RATE SETTING*/
    ST7789_WriteCommand(0xb2);
    ST7789_WriteSmallData(0x0c);
    ST7789_WriteSmallData(0x0c);
    ST7789_WriteSmallData(0x00);
    ST7789_WriteSmallData(0x33);
    ST7789_WriteSmallData(0x33);

    ST7789_WriteCommand(0xb7);
    ST7789_WriteSmallData(0x35);

    ST7789_WriteCommand(0x3a);
    ST7789_WriteSmallData(0x55); //18 RGB ,55-16BIT RGB

    //--------------------ST7789S Power setting--------//

    ST7789_WriteCommand(0xbb);
    ST7789_WriteSmallData(0x30);

    ST7789_WriteCommand(0xc3);
    ST7789_WriteSmallData(0x1c);

    ST7789_WriteCommand(0xc4);
    ST7789_WriteSmallData(0x18);

    ST7789_WriteCommand(0xc6);
    ST7789_WriteSmallData(0x0f);

    ST7789_WriteCommand(0xd0);
    ST7789_WriteSmallData(0xa4);
    ST7789_WriteSmallData(0xa2);

    /*ST7789S gamma setting*/

    ST7789_WriteCommand(0xe0);
    ST7789_WriteSmallData(0xf0);
    ST7789_WriteSmallData(0x00);
    ST7789_WriteSmallData(0x0a);
    ST7789_WriteSmallData(0x10);
    ST7789_WriteSmallData(0x12);
    ST7789_WriteSmallData(0x1b);
    ST7789_WriteSmallData(0x39);
    ST7789_WriteSmallData(0x44);
    ST7789_WriteSmallData(0x47);
    ST7789_WriteSmallData(0x28);
    ST7789_WriteSmallData(0x12);
    ST7789_WriteSmallData(0x10);
    ST7789_WriteSmallData(0x16);
    ST7789_WriteSmallData(0x1b);

    ST7789_WriteCommand(0xe1);
    ST7789_WriteSmallData(0xf0);
    ST7789_WriteSmallData(0x00);
    ST7789_WriteSmallData(0x0a);
    ST7789_WriteSmallData(0x10);
    ST7789_WriteSmallData(0x11);
    ST7789_WriteSmallData(0x1a);
    ST7789_WriteSmallData(0x3b);
    ST7789_WriteSmallData(0x34);
    ST7789_WriteSmallData(0x4e);
    ST7789_WriteSmallData(0x3a);
    ST7789_WriteSmallData(0x17);
    ST7789_WriteSmallData(0x16);
    ST7789_WriteSmallData(0x21);
    ST7789_WriteSmallData(0x22);


    //*********SET RGB Interfae***************
    ST7789_WriteCommand(0xB0);
    ST7789_WriteSmallData(0x11); //set RGB interface and DE mode.
    ST7789_WriteSmallData(0xC2);

    ST7789_WriteCommand(0xB1);
    ST7789_WriteSmallData(0x40); //set DE mode.
    ST7789_WriteSmallData(0x04);
    ST7789_WriteSmallData(0x0A);

    ST7789_WriteCommand(0x3a);
    ST7789_WriteSmallData(0x55); //18 RGB ,55-16BIT RGB

    ST7789_WriteCommand (ST7789_SLPOUT);    //  Out of sleep mode
    HAL_Delay(120);
    ST7789_WriteCommand (ST7789_NORON);     //  Normal Display on
    ST7789_WriteCommand (ST7789_DISPON);    //  Main screen turned on
    ST7789_WriteCommand (0x2c);
    ST7789_WriteCommand (0xff);
    HAL_Delay(50);
}
\$\endgroup\$
9
  • 1
    \$\begingroup\$ You don't use the LTDC module with an "intelligent" display. You connect your display as an external parallel memory device (possibly using the FMC module). The LTDC is for "raw" displays which need to be driven with RGB signals. \$\endgroup\$ Commented Oct 5, 2022 at 0:56
  • \$\begingroup\$ Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. \$\endgroup\$ Commented Oct 5, 2022 at 1:00
  • \$\begingroup\$ @brhans Thanks for your explanation. There are some explanations regarding RGB interface selection in its datasheet. Even the hardware connection is equal to LTDC pinout. This is the link to the data sheet: rhydolabz.com/documents/33/ST7789.pdf page 107 this is explained. \$\endgroup\$ Commented Oct 5, 2022 at 4:06
  • \$\begingroup\$ Do you want to strictly use RGB mode and not a 16-bit MCU parallel interface (using FMC) ? If so, what is the problem you're encountering ? Please edit your post with what's not working. \$\endgroup\$ Commented Oct 5, 2022 at 9:50
  • \$\begingroup\$ st.com/resource/en/application_note/… a useful application note if you want to use a parallel interface with FMC (which is easier than using RGB mode) \$\endgroup\$ Commented Oct 5, 2022 at 9:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.