Custom gui driver with FPGA flicker problem

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

    • Custom gui driver with FPGA flicker problem

      Hello,

      I designed a custom graphics driver with FPGA. MCU is 100 pin stm32h750 with QSPI 16 mb flash, have only internal ram, it run 480 mhz. MCU to FPGA indirect 16 bit FMC bus. (STEMWIN flexcolor driver, like SSD1963)FPGA have 32 mb SDRAM, 720x480 pixels 60 hz HDMI out. FPGA (SDRAM) to HDMI works very well. So, i have a two problem;1- when i use cached GUIDRV_FLEXCOLOR_M16C1B16 and GUI_SetRefreshHook(_RefreshHook) if my draw greater then 130x130 pixels screen begin to flickering. Because VSYNC signal timing not enought?? Can i creating VSYNC (TE) signal full one frame? (15-20fps will be enough for me.) like this; VSYNC___SDRAM_TO_HDMI____VSYNC___SDRAM_TO_HDMI...............FRAME1_____FRAME2________FRAME3______FRAME4..............Is there any other way to do this in emwin?
      2- I use internal ram for cache, STM32H750's D1 ram only 512kb, well my buffered screen size max is = XSIZE_PHYS * YSIZE_PHYS *2 <= 512 kb. Is there a way to circumvent the internal ram limitation? Any hardware solution is possible as I am using FPGA. reading pixel? create buffer inside FPGA? etc...? (ofcourse only FPGA side)Thank You,Erdal Turkekul

      Source Code

      1. VSYNC___SDRAM_TO_HDMI____VSYNC___SDRAM_TO_HDMI...............
      2. FRAME1_____FRAME2________FRAME3______FRAME4..............
    • Hi,

      You can set a hook function with GUI_SetControlHook() to react on the three cache commands, LCD_CC_LOCK, LCD_CC_FLUSH and LCD_CC_UNLOCK. This hook function is called right before emWin performs the desired operation.

      You might try to react on LCD_CC_FLUSH and wait for your VSYNC signal before letting emWin continue and update the screen.

      Something like this:

      C Source Code

      1. static int _WaitForVSYNC;
      2. static void VSYNC_ISR(void) {
      3. _WaitForVSYNC = 0; // VSYNC interrupt, reset flag
      4. }
      5. static void _CacheHook(int LayerIndex, Cmd) {
      6. GUI_USE_PARA(LAyerIndex);
      7. switch (Cmd) {
      8. case LCD_CC_FLUSH:
      9. for (_WaitForVSYNC = 1; _WaitForVSYNC; ); // Wait for VSYNC interrupt
      10. break;
      11. }
      12. }
      13. void LCD_X_Config(void) {
      14. //
      15. // ... Init emWin driver
      16. //
      17. // ...
      18. //
      19. // Set hook function
      20. //
      21. GUI_SetControlHook(_CacheHook);
      22. }
      Display All
      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.