GUIX - Display Orientation: Portrait to Landscape

Hi,

I'm using a PK-S5D9 Promotion Kit board to get me familiar with GUIX and touch display. I've successfully created the HelloWorld example and played around with GUIX, all is great.

However… All is done in portrait, but the final application must be in landscape. The display on the development board is 240Hx320V (portrait) and the final display will be 320Hx480V (also portrait) . I've tried to change the HelloWorld example from portrait to landscape but had partial success.

It does work when using the GUIX screen rotation feature with an extra buffer but I don’t want to use that because of RAM requirements and CPU performance issues. I must add external RAM for doing that on the final display.

I reckon it should be possible to do a screen rotation without it. The ILI9341 display driver has an option to swap rows and columns in the register:

Memory Access Control (36h)
Bit MV – Row / Column Exchange

Together with the MY – Row Address Order and MX – Column Address Order bits it is possible to do screen rotations of 90, 180 and 270 degrees without CPU intervention when transferring data from the RAM buffer to the display driver.

I’ve tried this and changed some settings in the Synergy Configuration settings of “g_display Display Driver on r_glcd” and finally got to the result as shown in the attachment. You can see the triangle in the upper left corner and the grey bar on the right starting at (new) X=240. I can’t get rid of these artefacts and I think it must have something to do with display settings.

So the question is: Does anyone know what to change to get rid of these artefacts?

  • Good day, Matthew!

    How are things going so far? Have you successfully changed the display orientation already?

    Best Regards,

    Sai
    RenesasRulz Forum Moderator
    https://renesasrulz.com/
    https://academy.renesas.com/
    en-us.knowledgebase.renesas.com/
  • Hello Matthew,

    Can you list the settings you specified in the GLCDC properties? Do you have ILI9341 command sequence you can share to get this result?

    As far as I remember settings in MADCTL register on ILI9341 are only used when you're driving the display through serial/8080/6800 interface so I'm surprised to see this is working with RGB and TCON signals.

    Regards
  • In reply to Renesas Karol:

    Hi, I'm sorry this reply took a while because...

    I'm afraid I've changed the project on the photo to use the second canvas and the GUIX screen rotation feature without backing up previous project. So stupid of me! For sure the settings file has changed now so the current one is of no use. I did not change much though, probably only:

    Output Horizontal active video cycles = 320
    Output Vertical active video cycles = 240

    Many other settings resulted in an run-time exception (I think it was) when changed.

    On the ILI9341 side: In lcd_setup.c I've just changed ILI9341V_Init() to set the MV - Row/Column exchange bit is set. I might also have set or cleared the MX and MY bits to mirror the canvas.

    void ILI9341V_Init(void)

    {

      // …………..

      // …………..

       lcd_write(ILI9341_POWER2,       "\x10", 1);

       lcd_write(ILI9341_VCOM1,        "\x3E\x28", 2);

       lcd_write(ILI9341_VCOM2,        "\x86", 1);

    //    lcd_write(ILI9341_MAC,          "\x48", 1);

       lcd_write(ILI9341_MAC,          "\x68", 1);  // <---- This sets the MV - Row/Column exchange bit

       lcd_write(ILI9341_PIXEL_FORMAT, "\x55", 1);          /* DPI[101]: RGB 16 bits/pixel; DBI[101] MCU 16 bit/pixel */

       lcd_write(ILI9341_FRM_CTRL1,    "\x00\x18", 2);      /* 79 kHz */

    }