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.

AM3517 LCD controller

Other Parts Discussed in Thread: AM3517

Hi ,

I want to work on another LCD screen on the AM3517. Now I have brightten the LCD by modifying some parameters after the board booted.    I only modified the /display0/timing . But  when I use it to display the video signal there always have mistakes. so is there a LCD controller to modify the parameter ?Where it is?And how will I to modify it?

Thanks.

  • Keciy

    Could you provide some more detail on the LCD you are using, how it is connected, and what the display errors look like? What software is used to program the panel?

     Paul

  • Hi,

    The LCD I use is 640*480,I have set      echo "31500,640/24/600/40,480/9/28/3" > /sys/devices/platform/omapdss/display0/timings

    I connect the LCD by connetting the matching signal line to the LCD and 60 pin.  The software I used is PSP 03.00.00.05

    when I test one example the LCD can display the pure colour.But there maybe still need some modify to display controller ,because when I display some others,it always can't display correctly.

    Still I want to ask  the format of  the  USB camera I use is YUV2,need I convert it to RGB565?when I convert it ,the display is  still wrong.It always display many colourful lines but no picture.The code I have used to code and decode by FFmeg ,the result is right.

    The code I convert the YUYV to RGB 565 as follows:

    for(i=0;i<height;i++)
     {
      
      for(j=0;j<width;j++)
      {
       m=j+i*width;
       n=j+width*i/2;
       
       Y=cap_ptr[m*2];
       if((i<height/2) && (j<width/2))
       {
         U=cap_ptr[n*4+1];
         V=cap_ptr[n*4+3];
       }
                  u = U -128;
                  v = V- 128;

                 rdif = v + ((v * 103) >> 8);
                 invgdif = ((u * 88) >> 8) +((v * 183) >> 8);
                 bdif = u +( (u*198) >> 8);

                 r = Y+ rdif;
                 g = Y- invgdif;
                 b = Y + bdif;
                
                 if (r>255)  r=255;
                 if (r<0)    r=0;
                 if (g>255)  r=255;
                 if (g<0)    r=0;
                 if (b>255)  r=255;
                 if (b<0)    r=0;
                
                  RGBdata[1] =( (r & 0xF8) | ( g >> 5) );
                  RGBdata[0] =( ((g & 0x1C) << 3) | ( b >> 3) );
                 
      disp_ptr[m]=(short)RGBdata[0];
      disp_ptr[m]=((disp_ptr[m]<<8)&0xff00);
      disp_ptr[m]+=(short)RGBdata[1];
                              
                  }
               };

    or  use the float format convert :

    /*for(i=0;i<height;i++)
     {
      
      //memcpy(disp_ptr,cap_ptr,width);
      for(j=0;j<width;j++)
      {
       m=j+i*width;
       n=j+width*i/2;
       
       y=cap_ptr[m*2];
       if((i<height/2) && (j<width/2))
       {
         u=cap_ptr[n*4+1];
         v=cap_ptr[n*4+3];
       }
       
       r = y + 1.402 *(v-128);
       g = y - 0.34414 *(u-128) - 0.71414 *(v-128);
       b = y + 1.772 *(u-128);
     
         RGBdata[0] =( (r & 0xF8)   | ( g >> 5) );
              RGBdata[1] =( ((g & 0x1C) << 3) | ( b >> 3) );
       disp_ptr[m]=(short)RGBdata[0];
       disp_ptr[m]=((disp_ptr[m]<<8)&0xff00);
       disp_ptr[m]+=(short)RGBdata[1];
       
      }
      
     }

    But the LCD is no reatin.

    Now I'm participating a competion,the committee now post me the SOC8200 board. It has the VGA port can connect to the computer monitor directly,when I run the program on it,the monitor can display pictures,but the speed is too low and the colour quality is too low. I don't no method to  improve it. Hope you can help me!

    Thanks.

  • Keciy,

        If your camera produces image data in a YUV color space, you must convert it to RGB somehow in order to display it on any LCD.  The best way to do this would be to utilize the color space converter that is built into the VID1 and VID2 layers of the display subsystem (DSS) block on OMAP.  I don't know the format your camera produces, but the Y, Cr and/or Cb bytes may need to be shuffled around to match the format that the DSS expects for input.  In any event, this will give you much better performance than trying to do it all in software.

      I don't understand how your YUV to RGB conversion function is supposed to work, but here is one that I have used extensively for reference.  It is simpler and works well, but again you will probably have to shuffle the input bytes from your camera to get the y, cr and cb in the right order.

    DWORD ycrcb_to_rgb(DWORD ycrcbval)
    {
        long r, g, b;
        double y, cr, cb;

        y  = ((ycrcbval >> 16) & 0xFF);
        cr = ((ycrcbval >> 8) & 0xFF);
        cb = (ycrcbval & 0xFF);
        y -= 16;
        cr -= 128;
        cb -= 128;

        r = (long)((y              + 1.403 * cr) * 1.143);
        g = (long)((y - 0.344 * cb - 0.714 * cr) * 1.143);
        b = (long)((y + 1.773 * cb             ) * 1.143);

        if (r < 0)
            r = 0;
        else if (r > 255)
            r = 255;

        if (g < 0)
            g = 0;
        else if (g > 255)
            g = 255;

        if (b < 0)
            b = 0;
        else if (b > 255)
            b = 255;

        return (r << 16) + (g << 8) + b;
    }

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

    Regards, Clay

  • Keciy

    What do you mean by "pure color"? If you still have it, you could use /usr/tests/omap-demo do run the picture display demo to check you LCD setup.

    The wiki page http://processors.wiki.ti.com/index.php/UserGuideDisplayDrivers_PSP_03.00.00.05 is another good resource.

    BRs

      Paul

  • Hi,

    I have run the omap-demo,but the LCD displays nothing.

    Now ,I don't how how to configure the parameters of the LCD to make it work correctly. I only run the command :
    echo "31500,640/24/600/40,480/9/28/3" > /sys/devices/platform/omapdss/display0/timings

    I don't know how to set it anymore.

    The "Pure colour" means the LCD can display  the coulour  which is pure red or blue or other colour I set  in my codes.

     

    Now I have modify my codes .On the board SOC8200 it can display the video signal in the computer monitor correctly ,but when I run the code in the AM3517 ,the LCD only display many colour lines no pictures.the display result is:

    Because  the competition require we use the AM3517 experimenter kit ,so I must display the video on the AM3517 LCD.

    Hope you can help me!

  • Keciy

    I want to make sure I understand you setup.  The issue you are having is with the AM3517 Experimenter board. Is this correct?

    Which LCD panel are you using (make/model)?  How do you have it connected?

      Paul

  • Keciy,

    Can you send us the data sheet for the LCD and also exactly how you have connected the AM3517 to this LCD please?

    BR,

    Steve