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.

A simple lcdc show on the VGA

Other Parts Discussed in Thread: AM3354

Hi, All:

I am working on am3354, and now I was confused by the lcdc modules, describe as follow:

I use the bootloader project  under AM335X_StarterWare_02_00_01_01, and in which I add the image show on the VGA. The initialization code is below:

void LCDInit(void)
{

unsigned int start = BL_LCDC_BUF_ADDR;
unsigned int end = start + 32 + ALL_PIXELS;
unsigned short *ptr;
unsigned int stat, i, j;

RasterClocksEnable(SOC_LCDC_0_REGS);

/* Disable raster */
RasterDisable(SOC_LCDC_0_REGS);

/* Configure the pclk */
//RasterClkConfig(SOC_LCDC_0_REGS, 65000000, 130000000);
RasterClkConfig(SOC_LCDC_0_REGS, 75000000, 150000000);

/* Configuring DMA of LCD controller */
RasterDMAConfig(SOC_LCDC_0_REGS, RASTER_SINGLE_FRAME_BUFFER,
RASTER_BURST_SIZE_16, RASTER_FIFO_THRESHOLD_8,
RASTER_BIG_ENDIAN_DISABLE);

/* Configuring modes(ex:tft or stn,color or monochrome etc) for raster controller */
RasterModeConfig(SOC_LCDC_0_REGS, RASTER_DISPLAY_MODE_TFT,
RASTER_DATA, RASTER_COLOR, RASTER_RIGHT_ALIGNED);

/* Configuring the polarity of timing parameters of raster controller */
RasterTiming2Configure(SOC_LCDC_0_REGS, RASTER_FRAME_CLOCK_LOW |
RASTER_LINE_CLOCK_LOW |
RASTER_PIXEL_CLOCK_HIGH|
RASTER_SYNC_EDGE_RISING|
RASTER_SYNC_CTRL_ACTIVE|
RASTER_AC_BIAS_HIGH , 0, 255);

RasterHparamConfig(SOC_LCDC_0_REGS, 1024, 53, 20, 232);
RasterVparamConfig(SOC_LCDC_0_REGS, 768, 6, 3, 30);


//RasterFIFODMADelayConfig(SOC_LCDC_0_REGS, 128);
RasterFIFODMADelayConfig(SOC_LCDC_0_REGS, 0);

/* Configuring the base ceiling */
RasterDMAFBConfig(SOC_LCDC_0_REGS, start, end, 0);
RasterDMAFBConfig(SOC_LCDC_0_REGS, 0, 0, 1);

ptr = (unsigned short *)start;
ptr[0] = 0x4000;
ptr = (unsigned short *)(start + 32);
for (i = 0; i < 64; i++)
{

if (i < 32)
{
    LCDRect(i*16, 0, 16, 768, RGB888to565((unsigned char)(255-32*i), 0, (unsigned char)(32*i)));
} else
{
    LCDRect(i*16, 0, 16, 768, RGB888to565((unsigned char)(32*(i-32)), 0, (unsigned char)(32*(i-32))));
}

}

/* Enable raster */
RasterEnable(SOC_LCDC_0_REGS);

}

In this function, I use DISP_PLL as lcdc functional clock with the frequency 150M.   The LCDRect function used to draw a rectangle.

The result was to pruduce 64 vertical bars with each 16 pixels width. All were OK except the last one,   which was the same as its previous.

No matter how to change the color, the result was the same!

I have no idea, please help me.

Thanks in advance.