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.

question on LCD raster configuration

Hardware: beaglebone

Software: starterware

IDE: ccsv5.5 on ubuntu 12.04

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I connect a LCD module to beaglebone. The initialization of LCD module has been done correctly. The 240x320 (qvga in portrait) LCD module accepts 16bit RGB signal, and also I want to use a 16bit RGB565 frame buffer. I modified the raster.c code for evmsk.

first I create a framebuffer to substitute the image1[].

typedef struct {
uint16_t palette_entry[16];
uint16_t pixel[320][240];
} qvga_fb_t;
#pragma DATA_ALIGN(frame_buffer, 4);
static qvga_fb_t frame_buffer;

then have a function to fill the frame buffer, with 3 color bands and a gray one.

static void fill_frame_buffer(void) {
  int i, j;
  memset(&frame_buffer, 0, sizeof(frame_buffer));
  frame_buffer.palette_entry[0] = 0x4000u;
  for (i = 0; i < 80; i++) {
  for (j = 0; j < 240; j++)
    frame_buffer.pixel[i][j] = 0xF800;
}
  for (i = 80; i < 160; i++) {
  for (j = 0; j < 240; j++)
    frame_buffer.pixel[i][j] = 0x07E0;
}
  for (i = 160; i < 240; i++) {
  for (j = 0; j < 240; j++)
    frame_buffer.pixel[i][j] = 0x001F;
}
  for (i = 240; i < 320; i++) {
  for (j = 0; j < 240; j++)
    frame_buffer.pixel[i][j] = 0x8410;
}
  }

after that modified the RasterDMAFBConfig in main() and LCDIsr()

RasterDMAFBConfig(LCDC_INSTANCE,
(unsigned int)&frame_buffer.pixel[0][0],
(unsigned int)&frame_buffer.pixel[320][240],
0);
RasterDMAFBConfig(LCDC_INSTANCE,
(unsigned int)&frame_buffer.pixel[0][0],
(unsigned int)&frame_buffer.pixel[320][240],
1);

also, change RasterModeConfig in SetUpLCD (change RASTER_DISPLAY_MODE_TFT_UNPACKED to RASTER_DISPLAY_MODE_TFT according to a old post in this forum)

RasterModeConfig(LCDC_INSTANCE, RASTER_DISPLAY_MODE_TFT, RASTER_PALETTE_DATA,   RASTER_COLOR, RASTER_RIGHT_ALIGNED);

All others codes and configuration remains. Don't know if RasterDMAConfig and RasterFIFODMADelayConfig should be changed.

I did NOT get the expected display. All screen display are filled with red color and there is an (almost) white vertical line in the left side (or may be right side, I don't know the default orientation of the LCD).

Can someone explain how to set up lcd/raster module to output 16 bit RGB565 and correctly setup the frame buffer?

Another thing confusing me is how to use RasterDMAFBConfig. Should the base addr point to the first byte of palette entry? or the first pixel data (skip 32 bytes of palette entry)? Why there is a minus 2 (-2) in calculating the ceiling address in examples?

  • Hi Matianfu,

    In the DMA FB configuration, the base addr has to point to the first byte of palette entry. In the above code snippet the base addr pointer is configured to the first pixel data.

    Modify the DMA frame buffer configuration as below:

    RasterDMAFBConfig(LCDC_INSTANCE,
    (unsigned int)&frame_buffer.palette_entry[0],
    (unsigned int)&frame_buffer.pixel[320][240],
    0);
    RasterDMAFBConfig(LCDC_INSTANCE,
    (unsigned int)&frame_buffer.palette_entry[0],
    (unsigned int)&frame_buffer.pixel[320][240],
    1);

    Please refer the following section in AM335x Technical Reference manual "13.3.5.2 Frame Buffer" to get more details about frame buffer configuration.

    Regards,

    M.Jyothi Kiran