0
\$\begingroup\$

I have ILI9486 based tft display to initiate via 16bit FSMC. I did gpio, fsmc, and lcd initialization.

    // Interface Mode Control
    LCD_WRITE_CMD(0xb0);
    LCD_WRITE_DATA(0x00);
    // Interface Pixel Format, 16 bits / pixel
    LCD_WRITE_CMD(0x3A);
    LCD_WRITE_DATA(0x55);
    // PGAMCTRL(Positive Gamma Control)
    LCD_WRITE_CMD(0xE0);
    LCD_WRITE_DATA(0x0F);
    LCD_WRITE_DATA(0x1F);
    LCD_WRITE_DATA(0x1C);
    LCD_WRITE_DATA(0x0C);
    LCD_WRITE_DATA(0x0F);
    LCD_WRITE_DATA(0x08);
    LCD_WRITE_DATA(0x48);
    LCD_WRITE_DATA(0x98);
    LCD_WRITE_DATA(0x37);
    LCD_WRITE_DATA(0x0A);
    LCD_WRITE_DATA(0x13);
    LCD_WRITE_DATA(0x04);
    LCD_WRITE_DATA(0x11);
    LCD_WRITE_DATA(0x0D);
    LCD_WRITE_DATA(0x00);
    // NGAMCTRL (Negative Gamma Correction)
    LCD_WRITE_CMD(0xE1);
    LCD_WRITE_DATA(0x0F);
    LCD_WRITE_DATA(0x32);
    LCD_WRITE_DATA(0x2E);
    LCD_WRITE_DATA(0x0B);
    LCD_WRITE_DATA(0x0D);
    LCD_WRITE_DATA(0x05);
    LCD_WRITE_DATA(0x47);
    LCD_WRITE_DATA(0x75);
    LCD_WRITE_DATA(0x37);
    LCD_WRITE_DATA(0x06);
    LCD_WRITE_DATA(0x10);
    LCD_WRITE_DATA(0x03);
    LCD_WRITE_DATA(0x24);
    LCD_WRITE_DATA(0x20);
    LCD_WRITE_DATA(0x00);
    // VCOM Control
    LCD_WRITE_CMD(0xC5);
    LCD_WRITE_DATA(0x00);
    LCD_WRITE_DATA(0x00);
    LCD_WRITE_DATA(0x00);
    LCD_WRITE_DATA(0x00);
    // Power Control 3
    LCD_WRITE_CMD(0xC2);
    LCD_WRITE_DATA(0x44);
    // Memory Access Control
    LCD_WRITE_CMD(0x36);
    LCD_WRITE_DATA(0x08);
    // Set rotation
    DIRECTION(0);
    // # Sleep OUT
    LCD_WRITE_DATA(0x11);
    DELAY(500); // ms
    // Display ON
    LCD_WRITE_DATA(0x29);

Mem. regs:

CMD: 0x60020000
DATA: 0x60000000

Timings:

  Timing.AddressSetupTime = 2;
  Timing.AddressHoldTime = 0;
  Timing.DataSetupTime = 5;
  Timing.BusTurnAroundDuration = 0;
  Timing.CLKDivision = 0;
  Timing.DataLatency = 0;

Wiring is double checked. NE1 is CS, RS -> A16, Reset set high.

The problem is that the display seems to be ON after all (gray background), but it's not possible to draw anything on it. Practically, doing DRAW_SOMETHING(...) the display just flashes and turns bright gray. I have checked every command and absolutely have no clue why this could happen. Any help highly appreciated thanks ~

----------------------[UPD]

correct memory addresses:

CMD: 0x60000000
DATA: 0x60020000
\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

The problem was found in memory addressing. Correct memory addresses are:

CMD: 0x60000000
DATA: 0x60020000
\$\endgroup\$
0
\$\begingroup\$

I'm trying to get my 3.5" lcd working. I've used your code as a starting point and I get a static snowstorm background. One error I spotted is that the below should be commands, not data

// # Sleep OUT
LCD_WRITE_DATA(0x11);
DELAY(500); // ms
// Display ON
LCD_WRITE_DATA(0x29);
\$\endgroup\$
3
  • \$\begingroup\$ Hi! That's correct. Besides, the error was in memory addresses. I had to flip them for this controller. Feel free to continue this topic if any questions. I have had some practice now. \$\endgroup\$
    – Sergio
    Aug 5, 2019 at 14:35
  • \$\begingroup\$ Sounds like we've been through the same pain. I've now got the display working properly, but I'm now working with the touch capability. Are you using that? \$\endgroup\$ Aug 7, 2019 at 8:35
  • \$\begingroup\$ Hey @user2177276. Sorry for a delay. I've made a Github repo, so you can check the complete code here github.com/way5/ili9486-driver-for-stm32-hal \$\endgroup\$
    – Sergio
    Aug 14, 2019 at 1:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.