Dear Sir :
I am new to EVM6437, I use the sample code(lookback) provided from 3th party, why we can see the output normally when using s-video channel, but output abnormal when using compositive channel. We check the initialization on VPFE and VPBE and found nothing strange, besides, trace the memory on CCDC->SDR_ADDR, we found the data does not change and keep 0x10801080 even though we play a picture from the TV-OUT and feed into the AV-IN on EVM6437.
below is the code :
======================================================
#define NTSC 1
#define PAL 0
#define COLORBARS 1
#define LOOPBACK 0
#define SVIDEO_OUT 1
#define COMPOSITE_OUT 0
Uint32 vpfe_addr=0x84000000;
Uint32 vpbe_addr=0x86000000;
/* ------------------------------------------------------------------------ *
* *
* vpfe_init( ntsc/pal ) *
* *
* ------------------------------------------------------------------------ */
static void vpfe_init( Uint32 ntsc_pal_mode )
{
Uint32 video_buffer = vpfe_addr;//VPFE_DDR2_ADDR;//DDR_BASE + ( DDR_SIZE / 2 );
Uint32 width;
Uint32 height;
if ( ntsc_pal_mode == NTSC )
{
width = 720;
height = 480;
}
else
{
width = 720;
height = 480;
}
VPFE_CCDC_SYN_MODE = 0x00032F84; // interlaced, with VD pority as negative
VPFE_CCDC_HD_VD_WID = 0x00000000; // H-sync pulse width=0; V-sync width=0;
VPFE_CCDC_PIX_LINES = 0;
/*
* sph = 1, nph = 1440, according to page 32-33 of the CCDC spec
* for BT.656 mode, this setting captures only the 720x480 of the
* active NTSV video window
*/
VPFE_CCDC_HORZ_INFO = width << 1; // Horizontal lines(pixels/per-line)
VPFE_CCDC_HSIZE_OFF = width << 1; // Horizontal line offset
VPFE_CCDC_VERT_START = 0; // Vertical start line
VPFE_CCDC_VERT_LINES = height >> 1; // Vertical lines(half-line/per-field)
VPFE_CCDC_CULLING = 0xFFFF00FF; // Disable cullng
/*
* Interleave the two fields
*/
VPFE_CCDC_SDOFST = 0x00000249;
VPFE_CCDC_SDR_ADDR = video_buffer;
VPFE_CCDC_CLAMP = 0x00000010;
VPFE_CCDC_DCSUB = 0;
VPFE_CCDC_COLPTN = 0;//0xEE44EE44;
VPFE_CCDC_BLKCMP = 0;
VPFE_CCDC_FPC_ADDR = 0;//0x86800000;
VPFE_CCDC_FPC = 0;
VPFE_CCDC_VDINT = 0x00000000;
VPFE_CCDC_ALAW = 0x00000004;
VPFE_CCDC_REC656IF = 0x00000003;
/*
* Input format is Cb:Y:Cr:Y, w/ Y in odd-pixel position
*/
VPFE_CCDC_CCDCFG = 0x00008800;
VPFE_CCDC_FMTCFG = 0x00004000;
VPFE_CCDC_FMT_HORZ = 0;//0x000002D0; // 720
VPFE_CCDC_FMT_VERT = 0;//0x0000020E; // 526
VPFE_CCDC_FMT_ADDR0 = 0;
VPFE_CCDC_FMT_ADDR1 = 0;
VPFE_CCDC_FMT_ADDR2 = 0;
VPFE_CCDC_FMT_ADDR3 = 0;
VPFE_CCDC_FMT_ADDR4 = 0;
VPFE_CCDC_FMT_ADDR5 = 0;
VPFE_CCDC_FMT_ADDR6 = 0;
VPFE_CCDC_FMT_ADDR7 = 0;
VPFE_CCDC_PRGEVEN_0 = 0;
VPFE_CCDC_PRGEVEN_1 = 0;
VPFE_CCDC_PRGODD_0 = 0;
VPFE_CCDC_PRGODD_1 = 0;
VPFE_CCDC_VP_OUT = 0x041A2D00;
VPFE_CCDC_PCR = 0x00000001; // Enable CCDC
}
/* ------------------------------------------------------------------------ *
* *
* vpbe_init( colorbars/loopback, ntsc/pal, svideo/composite ) *
* *
* ------------------------------------------------------------------------ */
static void vpbe_init( Uint32 colorbar_loopback_mode, Uint32 ntsc_pal_mode, Uint32 output_mode )
{
Uint32 video_buffer = vpbe_addr;//VPBE_DDR2_ADDR;//DDR_BASE + ( DDR_SIZE / 2 ) + ( DDR_SIZE / 4 );
Uint32 basep_x;
Uint32 basep_y;
Uint32 width;
Uint32 height;
if ( ntsc_pal_mode == NTSC )
{
basep_x = 122;
basep_y = 18;
width = 720;
height = 480;
}
else
{
basep_x = 132;
basep_y = 22;
width = 720;
height = 480;
}
/*
* Setup VPBE
*/
VPSS_CLK_CTRL = 0x00000018; // Enable DAC and VENC clock, both at 27 MHz
VPBE_PCR = 0; // No clock div, clock enable
/*
* Setup OSD
*/
VPBE_OSD_MODE = 0x000000fc; // Blackground color blue using clut in ROM0
VPBE_OSD_OSDWIN0MD = 0; // Disable both osd windows and cursor window
VPBE_OSD_OSDWIN1MD = 0;
VPBE_OSD_RECTCUR = 0;
VPBE_OSD_VIDWIN0OFST = width >> 4;
VPBE_OSD_VIDWIN0ADR = video_buffer;
VPBE_OSD_BASEPX = basep_x;
VPBE_OSD_BASEPY = basep_y;
VPBE_OSD_VIDWIN0XP = 0;
VPBE_OSD_VIDWIN0YP = 0;
VPBE_OSD_VIDWIN0XL = width;
VPBE_OSD_VIDWIN0YL = height >> 1;
VPBE_OSD_MISCCTL = 0;
VPBE_OSD_VIDWINMD = 0x00000003; // Disable vwindow 1 and enable vwindow 0
// Frame mode with no up-scaling
/*
* Setup VENC
*/
if ( ntsc_pal_mode == NTSC )
VPBE_VENC_VMOD = 0x00000003; // Standard NTSC interlaced output
else
VPBE_VENC_VMOD = 0x00000043; // Standard PAL interlaced output
VPBE_VENC_VDPRO = colorbar_loopback_mode << 8;
//VPBE_VENC_DACTST = 0;
//VPBE_VENC_DACSEL = 0x00004210;
/*
* Choose Output mode
*/
if ( output_mode == COMPOSITE_OUT )
VPBE_VENC_DACSEL = 0x00000000;
else if ( output_mode == SVIDEO_OUT )
VPBE_VENC_DACSEL = 0x00004210;
}
=================================================================