GUIDRV_FlexColor cannot let emwin graphic display on our HX8352 driver LCD

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

  • GUIDRV_FlexColor cannot let emwin graphic display on our HX8352 driver LCD

    Hello,

    First time use emWin graphics library. hope you could give me a help, Thanks.

    Our project use Microchip company MCU PIC32MZ, LCD display controller is HX8352 ( use 8080 CPU interface, 8 bits parallel port, CSn, WRn, RDn, C/Dn) .
    According to HX8352, I should use EmWin display driver GUIDRV_FlexColor, so I wrote the codes in LCD_X_Config(), see below. But after running the LCD_X_Config(), the whole system will restart, I cannot find out the reason ?


    void LCD_X_Config(void)
    {
    GUI_PORT_API PortAPI = {0};
    CONFIG_FLEXCOLOR Config = {0};
    GUI_DEVICE * pDevice;


    pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);

    LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
    LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);

    Config.FirstCOM = 0;
    Config.FirstSEG = 0;
    Config.Orientation = DISPLAY_ORIENTATION;
    //Config.RegEntryMode = 0;
    Config.NumDummyReads = 2;
    GUIDRV_FlexColor_Config(pDevice, &Config);

    PortAPI.pfWrite8_A0 = w_com;
    PortAPI.pfWrite8_A1 = w_dat;

    GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66712, GUIDRV_FLEXCOLOR_M16C1B8); // HX8352 with 16bpp, cache, 8 bit bus
    }
  • Hello,

    Not sure what causes a restart.

    Maybe you have a watchdog running and it causes the reset.

    Your configuration looks ok, from my point view. Depending on which HX8352 you are using, either HX8352A or HX8352B, you need a different mode.
    The HX8352A uses GUIDRV_FLEXCOLOR_F66712 and the HX8352B GUIDRV_FLEXCOLOR_F66715.

    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.
  • Thank you so much!

    According to your suggestion, I changed to HX8352B
    GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66715, GUIDRV_FLEXCOLOR_M16C0B8);

    added new PortAPI.pfWriteM8_A1 = LcdWriteDataMultiple;

    Never restart system, Thanks! But still cannot display graphics correctly (even background color).

    So I debug my software step by step, found, emWin GUI call write_ command (index of register) twice { the first one alway 0x00}, but write_data only once.
    I confuse for this: HX8352B use 8 bits parallel port, should write command (index of register) once (for example 0x02 register), write data maybe twice, if you emWin use 16 bits. Is right?

    Besides, for HX8352, I use 8080 CPU 8 bits parallel II (DB0-DB8, CSn, WRn, RDn, C/Dn), not use 4/4 wires Serial interface, not use SPI(2), HSIM interface. So Is it OK for GUIDRV_FlexColor?

    The post was edited 2 times, last by Judy ().