This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LCD Driver Configuration Questions.



Hi All,

I have attempted to modify the files bsp_cfg.h and lcd_vga.c in WinCE BSP 6.14.01 to drive a 640 X RGB X 480 LCD on our custom OMAP board.  The display is working - the text is readable but the color and pixels within bitmap in the window shell screen that has the OMAP logo do not look right.  Also, the red square of the power-up screen look like dark green.

I would appreciate any help that you can give me.  The details are below:

Our LCD has 18-bit data bus, same as that on the EVM but our schematic is different from that of the EVM.

On EVM, DSS_D0 .. DSS_D5 are connected to B0 .. B5; DSS_D6 .. DSS_D11 are connected to G0 .. G5; DSS_D12 .. DSS_D17 are connected to R0 .. R5.

On our board, DSS_D0 .. DSS_D5 are connected to B0 .. B5.   DSS_D8 .. DSS_D13 are connected to G0 .. G5; DSS_D16 .. DSS_D21 are connected to R0 .. R5.

DSS_D6, DSS_D7, DSS_D14, DSS_D15, DSS_D22, and DSS_D23 are not connected.

It is a 24-bit configuration but we do not use the most 2 significant bits for each color.

Can this hardware configuration work?  If so, how and where in the code that I can configure the display driver for 24-bit data bus.

Thanks,

Luan

  • Luan,

    If you are using the output in 24 bit configuration then you must connect your LCD to the UPPER bits of each color channel and not the lower bits.

    Have a look at the wiki here which might help.

    http://processors.wiki.ti.com/index.php/LCD_connectivity

    BR,

    Steve

  • Hi Steve,

    Thank you very much for the tip.  I will have the video cable changed to verify it right away.  In the mean time, would you please show me where in the BSP that I can configure the display for either 18 or 24 bits?

    Thanks,

    Luan

  • Luan,

    There are 2 aspects to setting the 24 bit mode. One is the actual configuration of registers (follow the DVI settings) and the other one is what you let display driver know. Both are set in lcd_vga.c (modify the DEFAULT_PIXELTYPE for the particular LCD you are using). Also any DSS subsystem register setting you may have to do for 24bit is also done in this file. Please note that 24bit has not been verified (as well as its performance impact) with this BSP. 

    Jatin

     

  • hi,

     

    you can also mask the bits which are not used in  the file

    csp\omap3430\display\ddgpe\omap_ddgpe.cpp

    In function: PixelFormatToBitMask

     

    Regards

    MGM

  • Hi Jatin and Muragesh,

    I did several things in an attempt to improve the display but it actually got worse.  Below  are what I did -

    (1) Change the video cable so that the upper 6 bits of each color are used; the lowest 2 bits are unused

    (2) In lcd_vga.c, choose  #define DEFAULT_PIXELTYPE                   DISPC_PIXELFORMAT_RGB32

    (3) In function OMAPDDGPE::PixelFormatToBitMask(), set

    *pRBitMask = 0x00fc0000;

    *pGBitMask = 0x0000fc00;

    *pBBitMask = 0x000000fc;

    (4) In function OMAPDisplayController::InitLCD(), set bits 7..6 of DSI_CTRL register to 2 for 24-bit data width.

    Am I still missing some settings?

    Thanks very much for all your help.

    Luan

  • Hi  Luan,

     

    1.
     In "csp\omap3430\display\"
    Where ever the checksfor PixelFormat,dwRGBBitCount is being done add support for 24bits(such as ddgpePixelFormat_24bppGeneric).

    2.
    In lcd_vga.c use
    #define DEFAULT_PIXELTYPE   DISPC_PIXELFORMAT_RGB24

    3.use bit mask as

    *pAlphaBitMask = 0xfc0000;
                *pRBitMask     = 0x03f000;
                *pGBitMask     = 0x000fc0;
                *pBBitMask     = 0x00003f;
    *****Verify it with your hardware connection for RGB data lines.

    4.Also check for your "SYSCLK" value and update in "dssai.cpp"

    Regards

    Muragesh

  • Luan,

    There are 2 parts to this issue.

    First, the frame buffer format and second the output format.

    The display sub-system will do any necessary conversion from frame buffer format to output format.

    I do not know enough about the software side of things, so can't comment too much there, but on the output hardware side you need to make sure that the hardware registers end up being set as follows...

    (0x4805 0440) DISPC_CONTROL : TFTDATALINES set to 0x3 if connected to the upper 6 bits of each color channel (24 bit output)

    Depending on which processing pipes are use the following registers should match the frame buffer formats...

    (0x4805 04a0) DISPC_GFX_ATTRIBUTES : GFXFORMAT

    (0x4805 04cc/051c) DISPC_VIDn_ATTRIBUTES : VIDFORMAT

    BR,

    Steve

  • Hi Steve, Jatin, and Mugagesh

    Thank you for all of your suggestions.  Currently I do not have time to implement your ideas and also the implementation for 24-bit output seems somewhat complicated to me, so I go back to use the default 18-bit output already supported by the WinCE BSP.  My problem now is that all the colors are displayed on my LCD in lighter shades as compared to the bitmap files.

    Can you give me some tips on how this might happen?  I appreciate your help very much.

    Luan

  • Luan,

    Could you possibly please let me know what values are in the following hardware registers?

    (0x4805 0440) DISPC_CONTROL

    (0x4805 04a0) DISPC_GFX_ATTRIBUTES

    How do you have your LCD connected to the DSS outputs?

    BR,

    Steve

  • Hi Steve,

    DISPC_CONTROL is initialized to 0x00018208.

    DISPC_GFX_ATTRIBUTES is initialized to 0x00AC.

    I now use 18-bit output; DSS_D0 .. DSS_D5 connected to B0 .. B5, DSS_D6 .. DSS_D11 connected to G0 .. G5, DSS_D12 .. DSS_D17 connected to R0 .. R5.

    Thanks,

    Luan

  • Hmm, these settings appear correct and your connectivity is good.

    Do both black pixels and white pixels look OK?

    BR,

    Steve

  • Hi Steve,

    The black and white pixels looks normal but red becomes burgundy, dark pink becomes light pink, dark gray becomes medium gray, etc...

    Thanks,

    Luan 

  • Hmm. Given that the frame buffer is 16 bit and that the DSS appears to be configured correctly for 16 bit to 18 bit conversion, and that black and white are good it points to there potentially being a mis-wiring of the LCD color lines.

    Can you generate a display where there are four horizontal bands, each with a ramp of red, green blue and gray and take a picture of the result for me please?

    BR,

    Steve

  • Hi Steve,

    I am not sure how to do that but I attach something here that you can look at.  At power-on time, the LCD is displayed with 4 colors: red, blue, green and yellow.  The red color is shown as burgundy on my screen.  However, it does not show well in this picture.

    While communicating with you today, I have also been thinking about the mis-wiring of the video cable since we modified it from 24-bit output to 18-bit output.  I will have another one built to make sure that it is not the cable problem.

    Please take a look at this picture and let me know of your opinion.

    Thanks,

    Luan

  • Are you able to display a bitmap image somehow?

    I can send you a bitmap with color ramps if you can let me know what resolution is best for you.

    BR,

    Steve

  • Hi Steve,

    I will figure out some way to display the bitmap image.

    My LCD specifications are as below:

    Active Area : 130.56mm (H) X 97.92mm (V)

    Number of Dots : 640(H) X 3(R,G,B) X 480(V)

    Color Depth : 6 Bits, 262,144 colors

     

    From the above info, I should be able to display a bitmap with 124 dpi.  However, all the bitmap images we use in our application are 96 dpi, so would you create two bitmaps, one with 124 dpi and one with 96 dpi.  Please send them directly to my email at lle@nmitkb.com.

    Thanks a lot,

    Luan

  • Luan,

    Here is a 640x480 RGB24 bitmap.

    You will need to use whatever utilities you already have in order to display this since there is no file format readily available for 18 bit images.

    The DPI settings are irrelevant in this application since you will be displaying it native on your LCD.

    BR,

    Steve

  • Hi Steve,

    As you suspected, we have found out that the video cable was mis-wired.  It is fixed and my display is now correct.

    Thanks very much for all your help.

    Luan

  • Excellent :)

    Glad you are working correctly now.

    BR,.

    Steve

  • Hi, code for configure LCD data line width placed here WINCE600\PLATFORM\TI_EVM_3530\SRC\DRIVERS\LCD\VGA\lcd_vga.c

    you will find 2 entries with DISPC_CONTROL_TFTDATALINES_18 define,

    OUTREG32( &g_pDispRegs->DISPC_CONTROL,
    DISPC_CONTROL_GPOUT1 |
    DISPC_CONTROL_GPOUT0 |
    DISPC_CONTROL_TFTDATALINES_18 |
    DISPC_CONTROL_STNTFT
    );

     correct to DISPC_CONTROL_TFTDATALINES_24 for your mode.
    i was developed PDA with QVGA display that use also 18-bit interface. i connect as follows:

    DSS_D0..DSS_D5 to LCD_B0..LCD_B5,
    DSS_D6..DSS_D11 to LCD_G0..LCD_G5 and
    DSS_D12..DSS_D17 to LCD_R0..LCD_R5.
    For my mode i used DISPC_CONTROL_TFTDATALINES_18 define.