Increase page change performance on application with no external RAM

  • Hello,

    I'm setting up a GUI application sample with STemWin on a custom board with an STM32F401 microcontroller which controls a display that mounts its controller (ST7789v) and I've managed to print on a screen the classic "Hello world" example.
    The board doesn't have any external RAM for frame buffering so only the available memory is the internal RAM (about 64KB, it will only be used for the libraries, not enough space for a complete frame) and the internal display device memory.
    Since the display controller is communicating with Intel 8080 I have setup the LCD_X_Config as:


    With the implementation of the top level functions:

    And the lower level functions which basically control the pins of the interface (DCX, CS, WRX, Data).

    First frame is shown correctly on the display and it takes a very short time to draw the entire page.
    The problem arises when I want to change something or when I simply want to change the color of the background like:

    Code
    GUI_SetBkColor(GUI_RED);
    GUI_Clear();

    This leads to a very slow refresh of the page with a visible redrawing of the display from the top to the bottom (it takes a couple of seconds).

    Is it possible to improve this behavior (am I missing something?) and which is the best solution to develop a GUI with different pages for targets with no frame buffer like this?

    Thank you!

    Mark

  • Hi Mark,

    The LCD_X_8080 functions, do they use bit banging (toggling the IO pins of the MCU) or do these functions use a dedicated hardware module (e.g. a 8080 module on the MCU)?

    Bit banging is pretty slow and will cause a visible build up on the screen. I recommend to use a hardware module for this.

    Please note, it is not necessary to use an 8080 interface with this driver. You could also use SPI for example. Of course, this depends on the available interfaces of the LCD controller.

    Regards,
    Sven

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Hi Mark,

    The LCD_X_8080 functions, do they use bit banging (toggling the IO pins of the MCU) or do these functions use a dedicated hardware module (e.g. a 8080 module on the MCU)?

    Bit banging is pretty slow and will cause a visible build up on the screen. I recommend to use a hardware module for this.

    Please note, it is not necessary to use an 8080 interface with this driver. You could also use SPI for example. Of course, this depends on the available interfaces of the LCD controller.

    Regards,
    Sven

    Hi Sven,

    thank you for your quick answer.

    The LCD_X_8080 functions use bit-banging, I'm not sure I have other options with this hardware, it is the first time I use this kind of displays with internal memory.
    Here it is one of the functions as an example:

    In the meantime I set-up the "DrawPolygon sample" and both the first drawing of the page and the update of single polygon are OK.
    If I increase the area of the Rect to be redrawn the slow redrawing appears again.


    Code
    y = 90;
    ...  
    // Display resolution is 240x320  
    GUI_ClearRect(100, y, 220, y + 85);
    //GUI_ClearRect(0, 0, 240, 320);  -> This will lead to the slow redrawing
    GUI_SetColor(GUI_BLUE);
    GUI_FillPolygon (&_aPointArrow[0], 7, X_START, y + 80);
    ...


    Do you have any other suggestions to avoid this effect to happen?

    Does the usage of Window manager makes the redrawing operations more efficient?

    Thanks a lot!

    Mark

  • Hello,

    one of the boards I work with is also a device with STM32F207 (120MHz, 128 kB SRAM) MCU and 240x320 LCD with ILI9341 controller using 16-bit 8080I bus. No external ram. No cache for display driver. Not much "faster" system than yours.

    Check the following moments in your code:

    1. Increase 8080I bus performance:
    DCX pin: set it to "1" in your "Readdata" function and toggle it "0" -> "1" in "Writecmd" function. Do not operate with it in "Writedata" function.
    WRX pin: set it to "1" in "Readdata" and toggle it "0" -> "1" in "Writecmd" and "Writedata" function.

    2. If possible ensure maximum system frequency for MCU.

    3. Use Window manager with simple windows / dialogs.

    And most important thing: call WM_SetCreateFlags(WM_CF_MEMDEV).

    This will enable drawing operations with windows using memory device per default.

    There is too few internal ram for a single memory device but this option uses automatical banding for memory devices by Window manager.

    All these actions provide pretty fast GUI drawing on my side.

    Alex.

    Edited once, last by LexaGB (June 19, 2020 at 5:54 PM).

  • Thank you Alex for your contribution, very appreciated.

    As you guessed there were some redundancies in my code in the 8080I bus which were the cause of the slow system response.
    Next step is to try if the WM is working properly as well.

    I've managed to setup the board with a 2.8 inches display with an ST7789v display controller and it looks like is working fine.

    I'm having some issues with another display of 3.5 inches with an ILI9488 display controller (8-bit parallel)
    Colors seems OK (even though the image looks stretch but I suppose the cause it might be wrong controller parameters setup) but fonts are NOT working (I see random pixels written instead of the text).

    Fonts are only working if I put


    Code
    GUI_SetTextMode(GUI_TM_TRANS);

    before the DispStringAt() command.

    Without this even the simplest "Hello world" demo is not working.

    Any ideas or suggestions on something that is missing in my configuration?

    Thank you!

    Mark

  • Hello,

    well, actually, I didn't work with ILI9488, maybe there's the problem with reading back pixel data in the right format, so we can think about the things:

    1. Check if code in your 8-bit functions (Readdata, WriteData etc...) is quite accurate and consistent with dedicated pixel data format which is set to ILI9488 during initialization (565 or 666).

    2. Check if pixel data format complies with the configured color conversion routine.

    3. If needed check if the function GUIDRV_FlexColor_SetReadFunc...() is using with the right parameters for reading back pixel data.

    4. Check if the function GUIDRV_FlexColor_SetFunc() is using with the right parameters (bus width etc...).

    Alex.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!