emWin does not working normal for some functions.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • emWin does not working normal for some functions.

    Hi to everyone,

    This is my first post and I am glad to hear from you and to help me with my issue.

    I use a Nucleo l152RE with 32 Mhz Crystal and a 320x240 pixels Display with the driver ILI9325. The display is connected with a 8 pins parallel interface.
    I have a strange behavior, some functions like GUI_Clear() and GUI_FillCircle() and etc. are not working properly. I use the following draw function for test purpose.

    C Source Code

    1. GUI_SetFont(&GUI_Font8x16);
    2. GUI_SetBkColor(GUI_BLUE);
    3. GUI_SetColor(GUI_WHITE);
    4. for(int x=0; x<320; x++) {
    5. for (int y=0; y<240; y++) {
    6. GUI_DrawPixel(x,y);
    7. }
    8. }
    9. //GUI_Clear();
    10. GUI_SetPenSize(10);
    11. GUI_SetColor(GUI_BLACK);
    12. GUI_DrawLine(50, 0, 150, 150);
    13. GUI_FillCircle(100,100,10);
    14. GUI_SetBkColor(GUI_WHITE);
    15. GUI_SetColor(GUI_BLUE);
    16. GUI_SetTextMode(GUI_TM_NORMAL);
    17. GUI_DispStringHCenterAt("GUI_TM_NORMAL" , 100, 0);
    18. GUI_SetTextMode(GUI_TM_REV);
    19. GUI_DispStringHCenterAt("GUI_TM_REV" , 100, 26);
    20. GUI_SetTextMode(GUI_TM_TRANS);
    21. GUI_DispStringHCenterAt("GUI_TM_TRANS" , 100, 42);
    22. GUI_SetTextMode(GUI_TM_XOR);
    23. GUI_DispStringHCenterAt("GUI_TM_XOR" , 100, 58);
    24. GUI_SetTextMode(GUI_TM_TRANS | GUI_TM_REV);
    25. GUI_DispStringHCenterAt("GUI_TM_TRANS | GUI_TM_REV", 100, 74);
    Display All


    The result is the following picture, as you can see the Text functions are working normally, but the functions GUI_FillCircle() and GUI_DrawLine() cannot draw with the right colors and I have a strange green color.
    If i use the function GUI_Clear(), then all the Background has this green color. At the beginning I use a for loop to fill the display with white pixels.
    Could some one help me, why i have this strange behavior ? If you want more code i can post it.
    I am waiting to hear about your opinions.
    [img]https://s13.postimg.org/un7v9nj53/IMAG0001.jpg[/img]
  • Hi,

    Unfortunately I can't say what causes the behavior.

    Did you configured everything properly?

    You need to use GUIDRV_FlexColor configured for the desired color depth.

    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: segger.com/ticket/

    Or you can contact us via e-mail.
  • i suppose that the strings are ok because the library writes pixel per pixel the display but with the other functions like , GUI_FillRect() , the library does not write pixel for pixel, logic, but she writes in GRAM the area and then sends only the color for every pixel. So i think, but i don't know why, the display driver cannot understand the format and i have this strange green color.

    Could some one help ?

    I used the function GUI_FillRect(100,100,110,110);


    and the debugging is the following :
    C:command, D:Data
    C:0x50
    D:0x64
    C:0x51
    D:0x6e
    C:0x52
    D:0xd1
    C:0x53
    D:0xdb
    C:0x20
    D:0x64
    C:0x21
    D:0xdb
    C:0x22
    D:121 times the value 0x7ee0 (i think the color)

    The post was edited 1 time, last by ntosis ().