Questions? Call us: +1 760-918-6722

Landscape with RGB Interface

Hi everybody!

I need some help to correctly initialize the ILI9341 driver for landsacape mode with RGB interface.

I amble to correctly initialize the display in both portrait and landscape orientation with parallel interface (8080).

With RGB interface I get it works in Portrait mode with the initialization code I found in the post "SDT028ATFT 16-Bit RGB Minimal Initialization Code".

In orther to use the display in landscape mode with RGB interface, I modified the initialization sequence as follow:

  • set bit MV in Memory Access Control register (36h) to swap rows with columns:
WriteCommand (0x36);
WriteParameter (0x28);
  • set the column register (2Ah) to 320 and page register (2Bh) to 240:
WriteCommand (0x2a); // column set
WriteParameter (0x00);
WriteParameter (0x00);
WriteParameter (0x01);
WriteParameter (0x3F);
WriteCommand (0x2b); // page address set
WriteParameter (0x00);
WriteParameter (0x00);
WriteParameter (0x00);
WriteParameter (0xEF);
  • modify the active area of the microcontroller RGB driver to 320 columns and 240 rows mantaining all other settings unchanged.

Whith this settings the display shows only the first 240 columns. The columns from 241 to 320 remain white.

Anybody know the right initialization procedure?

Thanks

Matteo

Replies

engineering_seacomp's picture
engineering_seacomp
July 13, 2018

Hi,

The easist way to fix this problem is to update you microcontroller VSYNC & HSYNC to be inline with displaying a 320 (column) x 240 (row) image or a 240x320 image.

In the 320x240 case, there should be 240 HSYNC pulses and for 240x320 there should be 320 HSYNC pulses.

 

 

engineering_seacomp's picture
engineering_seacomp
July 13, 2018

Hi,

The easist way to fix this problem is to update you microcontroller VSYNC & HSYNC to be inline with displaying a 320 (column) x 240 (row) image or a 240x320 image.

In the 320x240 case, there should be 240 HSYNC pulses and for 240x320 there should be 320 HSYNC pulses.

 

 

matteo.campese's picture
matteo.campese
July 19, 2018

Hi,

Thank you for feedback!

When I use the display in landscape mode, I already use the following settings (from ILI9341 datasheet):

  • Horizontal Synchronization (Hsync) = 10 dotclk
  • Horizontal Back Porch (HBP) = 20 dotclk
  • Horizontal Address (HAdr) = 320 dotclk
  • Horizontal Front Porch (HFP) = 10 dotclk
  • Vertical Synchronization (Vsync) = 2 Line
  • Vertical Back Porch (VBP) = 2 Line
  • Vertical Address (VAdr) = 240 Line
  • Vertical Front Porch (VFP) = 4 Line.

So the total number of HSYNC pulses is: 2 + 2 + 240 + 4 = 248 pulses.

In this condition, the display shows only the first 240 columns.

In order to get the display to show the remaining columns, I need to increase the VAdr up to 320 lines (one more column is showed by the display for each VAdr increment).

However, when I increase this value over 240 lines, I see to unwanted effects:

  1. Random pixels appear on the column next to the controller (the last row in portrait mode). These pixels appear immediately as VAdr is greater than 240 lines.
  2. Two white triangles appear on the top corners of the display and cover the showed image. These triangles grow in size (by incrementing VAd) up to 80 pixels when VAdr is equal to 320 lines.

For the first problem I have not yet found a solution.

To resolve the second side effect, I need to clear the WEMODE bit in the Interface Control register (F6h command).

So currently the display works with a slower refresh rate (due to VAdr increase) and some random pixels appear on the first column of the display.

Thank you for any help.

Matteo

 

+------------------------------------+
|                                    |
|                                   .|
|                                    |-------+
|                                   .|       |
|                                    |       |
|                                   .|       |
|                                   .|-------+
|                                   .|
|                                   .|
+------------------------------------+
                                    ^
                                    |
                                    +---- Random pixels


+------------------------------------+
|\                              \    |
|  \                              \  |
|____\                              \|-------+
|                                    |       |
| ^                               ^  |       |
| |                               |  |       |
| +------- white triangles -------+  |-------+
|                                    |
|                                    |
+------------------------------------+

engineering_seacomp's picture
engineering_seacomp
August 2, 2018

Hi,

What happens if you change register 0xB0 to "Bypass Mode" in RGB Interface Signal Control?

Thanks,

matteo.campese's picture
matteo.campese
August 3, 2018

Hi,
Thank you for your reply.
I already have set the ByPass_MODE bit since, without this bit set, the display not even rotates the image.
Here my complete driver initialization sequence:

// Release RESET line and wait for 250 ms

WriteCommand (0x01);   // software Reset
Pause (200);           // 200 ms pause

WriteCommand (0x28);   // Display OFF

WriteCommand (0xB0);   // RGB Interface Signal Control
WriteParameter (0xC0); // ByPass_MODE = 1, RCM [1:0] = "10" (RGB Mode = DE mode)

WriteCommand (0xF6);   // Interface Control
WriteParameter (0x00); // WEMODE = 0 => avoid white triangles
WriteParameter (0x00); //
WriteParameter (0x02); // RM = 1 (Interface for RAM Access = RGB interface)

WriteCommand (0x3A);   // Pixel Format Set
WriteParameter (0x66); // 18-bit RGB

WriteCommand (0x36);   // Memory Access Control
WriteParameter (0xE8); // Landscape (viewing angle: Right (3:00))
//WriteParameter (0x28); // Landscape Inverted (viewing angle: Left (9:00))

WriteCommand (0x2a);   // Column Address Set
WriteParameter (0x00); // SC = 0
WriteParameter (0x00);
WriteParameter (0x01); // EC = 319
WriteParameter (0x3F);

WriteCommand (0x2b);   // Page Address Set
WriteParameter (0x00); // SP = 0
WriteParameter (0x00);
WriteParameter (0x00); // EP = 239
WriteParameter (0xEF);

WriteCommand (0x11);   // Sleep OUT
Pause (200);           // 200 ms pause

WriteCommand (0x29);   // Display ON

Moreover, even with the WEMODE bit cleared, I can see the effect of the white triangles on the screen: when I change the displayed image on the screen, I can see the white triangles just for an instant.

Thank you for your support.

Matteo Campese