Jump to content

PaulyLV

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by PaulyLV

  1. 2 hours ago, Joel Bodenmann said:

    The file2c utility simply creates a C array of the byte-content of the file you feed into it. It doesn't perform any conversion. In fact, it doesn't even know whether you feed it a picture, an audio file or an SQL database dump. It just wraps binary data into a C array and adds some entries to use it with ROMFS.
    If you need to do conversions you'll have to make them before feeding the file through file2c.

    @inmarket An STM32F4 with LTDC and external SDRAM via FMC can actually handle a 320x240 display with two layers and RGB565. I think it can also handle 320x480. I was working on a project not so long ago with a 480x480 display, dual layer LTDC and RGB565.
    But yes, this is definitely true: Bandwidth considerations need to be part of the hardware design phase. If your application needs a lot of I/O bandwidth then LTDC can be a real show stopper - especially when paired with SDRAM :D

     

    Here are snippets of the C files generated using file2c utility and LCD image converter (specified RGB565 format). I don't understand how both these arrays would generate the same result when used as the framebuffer address in LTDC. Sorry that the snippets I included are actually two different images so they will not generate the same result, but I hope you understand what I am trying to ask. Does the 8-bit vs 16-bit data format not matter?image.png.dd1a07825ed645589ea33a85e39e6357.png

     

     

    image.png.289cbc609332a917e93af6a2fbb13dbc.png

     

     

  2. 4 hours ago, inmarket said:

    There seems to be a confusion here between the display DPI interface and the framebuffer format. They usually do not need to be the same. For most controllers, they will do the conversion on the fly between the frame buffer RAM interface and the DPI lcd interface. E.g. if you are using an 8 bit palette framebuffer format the display controller will do the palette lookup to create the 18/24 bit wide DPI data. Similarly, the framebuffer can be in RGB565 format which is efficient for the CPU, RAM and memory usage, and convert it on the fly to the 18bit DPI interface (by bit shifting the red and blue values).

    Layering also occurs at this level. Layers involves taking 2 framebuffers in potentially different pixel formats and "mixing" them to produce a single 18/24 bit hardware DPI value for the LCD.

    That is the other thing about layers, you need a full size framebuffer for each layer. They can usually be in different pixel formats. In fact, they may have to be in different pixel formats in order to not exceed the total RAM bandwidth limitations.

    E.g. an STM4 chip using LTDC with external RAM can only support 1 x 320x240 framebuffer at RGB565 unless frame rates are quote low. If you want the 2nd layer it needs to run at RGB232 or an 8 bit palette mode to meet RAM and LTDC bandwidth requirements. As implied there are things that can be done to help here, 2 x RGB565 are available at low frame rates. It may help to split the RAM interface, it may be possible to use higher speed static RAM, a different CPU may also help etc. I will leave the bandwidth calculations to be part of your hardware design.

     

    Yes, I am definitely not understanding something. I would like to use 18-bit DPI interface with LTDC. According to the LTDC application note, it is possible. But, in the gdisp_lld_config.h file included in the STM32LTDC folder in uGFX, the pixel formats mentioned are only RGB565 and RGB888. Second, in "stm32f4xx_ltdc.h", RGB666 is not listed as a pixel format. Third, in "gdisp_lld_STM32LTDC.c", only two pixel formats are available. Are you saying that the pixel format specified in these files is not related to the DPI interface but is the framebuffer format?  How does the LTDC peripheral "know" that I want the RGB666/18-bit DPI format then? What am I missing?

      image.thumb.png.5974efb104e1039ec7c0dd6a8f042fa4.pngimage.png.97b1a9f22c2b69e87abcd29c1fc67c8c.png

    image.png.c68c4c86bfccdc66dba4f42e8ad7a0a0.png

  3. I definitely feel a step closer. :) I set up a smaller array in RAM and was able to display information that our product is supposed to display. The current design does not have SDRAM on it. Still trying to make a case that we need it. The requirement is to only update a certain process value on the screen each time but, as far as I can tell, LTDC will update the entire frame each time, correct? Even if I set up two layers, with the second layer only updating the process value I still need the minimum amount of RAM for one full frame (320 x 480 x 2bytes per pixel). I think the colors are messed up due to the hardware but since that is on the PCB I will have to wait for the next iteration of the board to check that. Is there a way to specify the pixel format in the 'file2c' utility? I ended up using the 'LCD image converter' which was actually working ok once I realized that it was the hardware that needs to be updated.  

    image.png

  4. I commented out the gdisp_lld_draw_pixel function. This has stopped the microcontroller from resetting as soon as LTDC is enabled. The reset is from an exception frame. I wonder if has to do with the frame buffer address being that of an array stored in flash. I will need to look into that some more but for now I am trying to display an image to check if LTDC is working. 

    I am using a header file for an image that I generated using a program called 'LCD_Image_converter' that I found online. I am able to display something with LTDC but it is not the right color and the resolution is really bad. My timing parameters are all within the range specified by the LCD datasheet. I am using the RGB565 pixel format but my hardware is connected for RGB666. I chose RGB565 since LTDC does not support RGB666. Could this be the reason I am getting such a pixelated image with wrong colors? Is the issue with the header file I am generating for the LCD? I tried using file2c program in uGFX and had less success. Any help you can provide is appreciated. 

    HBP 4,  HFP - 10, VBP - 2, VFP - 2 ( suggested by field engineer)

    H_Low - 41, V_Low - 10 (from IAR example for LTDC)

    LCDCLK freq - 12 MHz, HSync - 32 kHz, VSync - 64 Hz

    image.png.4ac6ba6b8dbb27313ee7a68e8307cc5b.png

    IMG_20231107_141851461.jpg

    World480x320.BMP

  5. I got the latest uGFX STM32LTDC functions and I set up LTDC with the following - single layer, pixel format RGB565, edited the width and height for ILI9488 but left the front porch, back porch settings as is. 

    After I enable LTDC, I can see the HSYNC and VSYNC signals. The microcontroller resets during the call to gDispClear.  

    I enabled the interrupt but I'm not really sure what needs to happen in the interrupt service handler. Are there any examples using uGFX STM32LTDC you could recommend? Not sure if the incomplete interrupt handler is causing the reset. 

  6. I have an update. My teammate was able to get colors to display on the screen using the SPI interface. The initialization sequence had to be tweaked as well as the gdisp_lld_write_color function to use RGB666 pixel format. I will attach the initialization sequence in case it helps someone else using this LCD screen in the future. 

    LLDSPEC void gdisp_lld_write_color(GDisplay *g) {
    //    write_data(g, gdispColor2Native(g->p.color));
        write_data(g, (gU8)((gdispColor2Native(g->p.color) & 0x0003F000) >> 10));
        write_data(g, (gU8)((gdispColor2Native(g->p.color) & 0x00000FC0) >> 4));
        write_data(g, (gU8)((gdispColor2Native(g->p.color) & 0x0000003F) << 2));
      }

    gdisp_lld_init_ILI9488.txt

  7. The field engineer says that the IM pins on my LCD sample are hardwired for a 3-wire serial interface. If what he is saying is right, then all LCDs that need SPI initialization would ship with IM pins set to SPI interface. Then what is the point of having various settings for IM pins. This makes no sense to me. I am suspicious of the initialization code as well. Oddly enough, the 'All pixels on' command only works when the 'Display Function control'(B6h) command is using default parameters. Why one would affect the other is beyond me. I would assume the command should work no matter what your interface as long as the SPI connection is good.  

    I am desperate and willing to try anything to see something other than white on my display. :) I tried to set all the bits on the "LCD red" pins and don't see anything. Did you mean setup LTDC first and then set the pins high/low? 

  8. Thank you Joel and inmarket for your responses.

    Yes, STM32F429 supports only 8-bit and 16-bit SPI. The discovery board uses the 4-line SPI so 8-bit SPI would work since the data/command line is separate as you said and does not need to be transmitted over the SDA line. 

    My teammate was able to get the 'All pixels on' command working with bit-banging SPI so the initialization sequence should be making it out but not able to see any color yet. When placing the order for the LCD, we had requested an 18-bit parallel interface. The status of the IM pins is confusing because if all LCDs need to be initialized using SPI then are the IM pins always set to serial interface? Then, what's the point of having the other configurations mentioned in the datasheet? I am checking with our LCD supplier to confirm the configuration of the IM pins on the LCDs we have. Would it be possible to display color via serial or parallel interface irrespective of the IM pins status based on what the initialization sequence does? 

     

  9. I turned on the gfx logo also but I don't see anything on the screen for that either. I guess I don't have the SPI connection working the way it is supposed to be. The white screen baffles me. I would expect blank screen if SPI was not working but I guess something is making it across and the LCD interprets that as all white. There are different brightness levels to the "white screen" if that makes sense.  

    In gfxconf.h
    #define GFX_USE_OS_RAW32                               GFXON
    #define GFX_OS_HEAP_SIZE                               24000
    #define GFX_USE_GDISP                                  GFXON
    #define GDISP_NEED_VALIDATION                          GFXON
    #define GDISP_NEED_CIRCLE                              GFXON
    #define GDISP_NEED_MULTITHREAD                         GFXON
    #define GDISP_NEED_TEXT                                GFXON
    #define GDISP_NEED_TEXT_WORDWRAP                       GFXON
    #define GDISP_NEED_TEXT_KERNING                        GFXON
    #define GDISP_INCLUDE_USER_FONTS                       GFXON
    #define GDISP_NEED_IMAGE                               GFXON
    #define GDISP_NEED_IMAGE_GIF                           GFXON
    #define GDISP_NEED_IMAGE_BMP                           GFXON
    #define GDISP_STARTUP_COLOR                            Black
    #define GDISP_NEED_STARTUP_LOGO                        GFXON
    #define GFX_USE_GWIN                                   GFXON
    #define GWIN_NEED_GRAPH                                GFXON
    #define GFX_USE_GFILE                                  GFXON
    #define GFILE_NEED_ROMFS                               GFXON

    In gdisp_lld_config.h
    #define GDISP_HARDWARE_STREAM_WRITE        GFXON
    #define GDISP_HARDWARE_CONTROL                  GFXON
    #define GDISP_LLD_PIXELFORMAT            GDISP_PIXELFORMAT_RGB233

  10. Joel, thank you for your earlier responses and for checking in. Unfortunately, I am still stuck on the flashing white screen.

    So far, I have tried to use 16-bit SPI since I technically need 9-bit transmission to send the D/C bit. No display. 

    I used the original uGFX initialization routine for ILI9488 with RGB565 pixel format. Still flashing white screen. 

    I changed the pixel format to RGB666 and attempted to send 3 bytes of data by calling write_data 3 times within gdisp_lld_write_color(). This causes the microcontroller to reset. Not good. 

    The project I am using calls gDispClear and gDispFillArea periodically. I think my white screen is coming from these calls but no matter how I change the parameters, I cannot seem to see any colors on the screen. One of the SPI transmissions is in the attached image where the blue represents clock and the pink represents data. There are only 8 clock cycles but 9-bits of data. I wonder if this is what is causing the issue. Another colleague of mine also tried to "bit bang" the SPI interface but he sees a white screen as well. The only available data formats using 3-line SPI on ILI9488 are 8 colors or 262K colors. The current pixel format is set to RGB233. 

    image.png.f01656dabcf1b677e1e7ba3a09a23593.png

     

  11. Another question I had

    In function gDispGClear(), area = 320 X 480,

     for(; area; area--)
                    gdisp_lld_write_color(g);

    which means 'write_data' is called for each pixel, right? I would expect to be able to write a color to the screen by writing a value in here but even that does not seem to be working. I feel like I am missing something fundamental about how the interface works. 

    • My team purchased the LCD from US Micro and received the initialization sequence from them.
    • The initial plan was to use RGB666 and LTDC but since we ran into some stumbling blocks like not realizing that a SPI connection is required to initialize the LCD in the first place, the LTDC plan was put on hold. For now, the goal is to get the LCD to display some color using SPI. In the initialization sequence, command 3Ah selects the interface and I think it is set to both DPI and DSI. 
    • I am not sure what my expectation on the SPI bus should be. Based on the ILI datasheet, SPI data for RGB666 looks like this but does that mean that each write_data() call would actually need to be called 3 times for each pixel which is why I asked about modifying  gdisp_lld_write_color() function.
    • image.png.dd0840199e5614d5263d675b69495ab7.png
  12. Hello, 

    I am new to working with LCD screens and uGFX. My setup uses STM32F429 with IAR EW and a ILI9488 (320 X 480) LCD. I have attached the uGFX files I modified. My goal is to display a splash screen on the display using SPI. As of now, the display flashes completely white and then dark. This corresponds in code to where the display is toggling between a 'Home' screen and an 'Error Message' screen (I am using an existing project that previously used ST7798). The hardware pins on the ILI9488 are set for 3-line SPI. I wonder if I am writing the data wrong in the gdisp_lld_write_color() function or I should be enabling some other mode instead of GDISP_HARDWARE_STREAM_WRITE? Could someone please give me some suggestions to try? Thanks!

    board_ILI9488.h driver.mk gdisp_lld_config.h gdisp_lld_ILI9488.c

×
×
  • Create New...