Hello,
I am driving an Optrex T-51750GD065J-LW-AON LCD 640x480 progressive display using the TMS320DM6437 VPBE and successfully displaying a stable RGB888 video window 0 on the the LCD panel. The problem I am having is that the window appears to have TWICE the width that I specify in the VIDWIN0XL register.
A secondary problem that I am noticing is that the VPBE appears to be reading/displaying TWICE as much data from the DDR that it should (640x480*3/2 instead of 640x480*3/4 bytes). My VIDWIN0OFST is set to (640*3)/32 which I think is correct. If I set it to ((640/2)*3)/32 it seems work though.
The GEL code is below.
This is the procedure I follow:
1) I power cycle and I connect to the DSP via the XDS510. The target hardware is based on the Davinci TMS320DM6437 EVM so the standard GEL file supplied with the examples configures the PLLs, PINMUX etc...
2) I clear the video window 0 memory with Clear_VPBE_frame1(). I am displaying RGB888 so I clear at least 640*480*3 bytes.
3) I call Config_VPBE_pins() to configure the PINMUX for my RGB666 LCD interface. The DSP needs to be the master and generate RGB666 data, VD, HD, OE and CLK.
4) I call Config_VPBE_LCD() which displays a stable colour video window 0 on the LCD with the correct height but with TWICE the specified width.
If I monitor the LCD OE and one of the LCD RGB666 colour lines with an oscilloscope with video winodow 0 displayed, I can show that the DSP is generating a window that is twice the width that is specified in the VIDWIN0XL register. With VIDWIN0XL set to 160, I get a 320 pixel wide window.
I have monitored the LCD signals and am happy that I meet all the LCD datasheet timings and are within the specified limits.
I would appreciate any help.
Many thanks in advance
Marcos
Electronics/software design engineer
hotmenu
Config_VPBE_LCD()
{
/* Enable clocks to VPBE */
*VPSS_CLKCTL &= ~(3 << CLKCTL_MUXSEL_SHIFT);
*VPSS_CLKCTL |= ((0 << CLKCTL_MUXSEL_SHIFT) |
_BV(CLKCTL_DACCLKEN_SHIFT) |
_BV(CLKCTL_VENCLKEN_SHIFT));
/* LCD Non-standard and Progressive timings */
*VPBE_VMOD = 0;
*VPBE_HSPLS = 8;
*VPBE_VSPLS = 5;
*VPBE_HINT = 12 + 640 + 200 - 1;
*VPBE_HSTART = 12;
*VPBE_HVALID = 640;
*VPBE_VINT = 12 + 480 + 2 - 1;
*VPBE_VSTART = 12;
*VPBE_VVALID = 480;
*VPBE_HSDLY = 0;
*VPBE_VSDLY = 0;
/* DCLK */
*VPBE_DCLKCTL = (1 << DCLKCTL_DCKPW_SHIFT) |
_BV(DCLKCTL_DCKEC_SHIFT);
*VPBE_DCLKPTN0 = 0x00000003;
*VPBE_DCLKPTN1 = 0x00000000;
*VPBE_DCLKPTN2 = 0x00000000;
*VPBE_DCLKPTN3 = 0x00000000;
*VPBE_DCLKPTN0A = 0x00000003;
*VPBE_DCLKPTN1A = 0x00000000;
*VPBE_DCLKPTN2A = 0x00000000;
*VPBE_DCLKPTN3A = 0x00000000;
/* Enable vertical and horizontal out syncs */
*VPBE_SYNCCTL |= 0x00000003;
/* Enable digital output */
*VPBE_VIDCTL = (0 << VIDCTL_DOMD_SHIFT) |
_BV(VIDCTL_VCLKE_SHIFT);
*VPBE_LCDOUT = _BV(LCDOUT_OEE_SHIFT);
/* Setup window */
*VPBE_BASEPX = 0;
*VPBE_BASEPY = 12;
/* Win 0 */
*VPBE_VIDWIN0XP = 0;
*VPBE_VIDWIN0YP = 0;
*VPBE_VIDWIN0XL = 160;
*VPBE_VIDWIN0YL = 480;
*VPBE_VIDWIN0ADR = 0x81000000;
*VPBE_PPVWIN0ADR = 0x81000000;
*VPBE_VIDWIN0OFST = (640*3)/32;
/* RGB888 */
*VPBE_MISCCTL = _BV(MISCCTL_RGBEN_SHIFT);
*VPBE_VIDWINMD = _BV(VIDWINMD_VFF0_SHIFT) |
_BV(VIDWINMD_ACT0_SHIFT);
/* OSD 0/1 */
*VPBE_OSDWIN0MD = 0;
*VPBE_OSDWIN1MD = 0;
/* LCD Non-standard and Progressive timings */
*VPBE_VMOD = (_BV(VMOD_VMD_SHIFT) | _BV(VMOD_VENC_SHIFT));
}
hotmenu
Clear_VPBE_frame1()
{
/* Fill buffer */
GEL_MemoryFill(0x81000000, 0, (640 * 480 *3) /4, 0x7F7F7F7F, 0x12);
}
hotmenu
Config_VPBE_pins()
{
/* Setup pins for VPBE */
*PINMUX0 &= ~((7 << PINMUX0_RGBSEL_SHIFT) |
(7 << PINMUX0_AEM_SHIFT) |
(1 << PINMUX0_VPBECKEN_SHIFT) |
(3 << PINMUX0_VENCSEL_SHIFT) |
(3 << PINMUX0_CS3SEL_SHIFT) |
(3 << PINMUX0_CS4SEL_SHIFT) |
(3 << PINMUX0_CS5SEL_SHIFT));
*PINMUX0 |= ((2 << PINMUX0_RGBSEL_SHIFT) |
(2 << PINMUX0_VENCSEL_SHIFT) |
(2 << PINMUX0_CS3SEL_SHIFT) |
(2 << PINMUX0_CS4SEL_SHIFT) |
(2 << PINMUX0_CS5SEL_SHIFT));
*PINMUX1 &= ~(7 << PINMUX1_HOSTBK_SHIFT);
*VPSS_CLKCTL &= ~(3 << CLKCTL_MUXSEL_SHIFT);
*VPSS_CLKCTL |= ((0 << CLKCTL_MUXSEL_SHIFT) |
_BV(CLKCTL_VENCLKEN_SHIFT));
}