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.

DM6446 Preview Engine Problem

I'm using the DM6446 EVM to acquire and display image data from an imager.  I configured the CCDC to acquire and store the 14-bit image data to SDRAM with no issues.  I then configured the Preview Enginer to convert the acquired data to a displayable format (8-bit) and stored that result in another portion of SDRAM.  Finally I configured the OSD/VENC to output it to a monitor.

I noticed that the vertical sync on the displayed image slowly creeps down the monitor over time (quite fast at first but then slows down).  So the displayed image is "wrapped" where the top of the image starts in the middle of the display and wraps around.  Not sure why this happens?? 

I've downloaded the acquired portion of SDRAM to the PC and it looks fine.  I downloaded the SDRAM output of the Preview engine and it is "wrapped".

I've also noticed that occasionally (every 5-10 seconds), the acquired image data seems to get stored starting at the beginning of the SDRAM (0x80000000) instead of where I configured it to be stored (0x81000000).  Not sure if these issues are related.

Any ideas??

  • Can you please check dimensions of capture/display data like width, height, pitch and bpp. Are you saying that whatever you capture from CCDC looks fine on PC where as whatever you capture from previewer is wrapped? In that case, can you provide video files?

  • I attached animage file.  The left image is a pic of my hand in front of the imager.  It is the output of the CCDC downloaded from the SDRAM to the PC's memory via CCS.  It's a raw 14-bit image.  Sorry we have not calibrated the imager yet so it is a little out of focus. The right image is the same image (lowest 8 bits) output after the Preview Engine and again downloaded from SDRAm to the PC's memory via CCS.  Notice that the vertical sync is wrong and the image is wrapped (part of the bottom of the image is at the top).  Over time, the vertical sync will continue to travel down the Preview Engine output.

    Here is my code that initializes the CCDC and Preview Engine (height=256, width=320, sbuffer=0x81000000, pbuffer=0x82000000, bitdepth=14)

         // Initialize the Preview Engine first
        PREV_HORZ_INFO = (2 << 16) | (width-2);
        PREV_VERT_INFO = (0 << 16) | (height-1);
        PREV_RSDR_ADDR = 0x0;
        PREV_RADR_OFFSET = 0x0;
        PREV_DSDR_ADDR = 0x0;
        PREV_DRKF_OFFSET = 0x0;
        PREV_WSDR_ADDR = pbuffer;
        PREV_WADD_OFFSET = width << 1;
        PREV_AVE = 0x0;
        PREV_HMED = 0x0;
        PREV_NF = 0x0;
        PREV_WB_DGAIN = 0x100;
        PREV_WBGAIN = 0x20202020;
        PREV_WBSEL = 0x0;
        PREV_CFA = 0x0;
        PREV_BLKADJOFF = 0x0;
        PREV_RGB_MAT1 = 0x00000100;
        PREV_RGB_MAT2 = 0x00000000;
        PREV_RGB_MAT3 = 0x00000100;
        PREV_RGB_MAT4 = 0x00000000;
        PREV_RGB_MAT4 = 0x00000100;
        PREV_RGB_OFF1 = 0x0;
        PREV_RGB_OFF2 = 0x0;
        PREV_CNT_BRT = 0x1000;
        PREV_CSUP = 0x0;
        PREV_SETUP_YC = 0xFF00FF00;
       
        PREV_PCR = 0x04100001;          // Enable Preview Engine
     
    // Initialize the CCDC registers second to start flow of images
        VPFE_SYN_MODE   = 0x30000 | (16-bitdepth) << 8;
        VPFE_HD_VD_WID  = 0;
        VPFE_PIX_LINES  = 0;

        VPFE_HORZ_INFO  = width-1;      // Horizontal lines
        VPFE_HSIZE_OFF  = width << 1;   // Horizontal line offset
        VPFE_VERT_START = 0;            // Vertical start line
        VPFE_VERT_LINES = height-1;     // Vertical lines
        VPFE_CULLING    = 0xFFFF00FF;

        VPFE_SDOFST     = 0x0;
        VPFE_SDR_ADDR   = sbuffer;
        VPFE_CLAMP      = 0;
        VPFE_DCSUB      = 0;
        VPFE_COLPTN     = 0x0;
        VPFE_BLKCMP     = 0;
        VPFE_FPC_ADDR   = 0x86800000;
        VPFE_FPC        = 0;
        VPFE_VDINT      = 0;
        VPFE_ALAW       = 0;
        VPFE_REC656IF   = 0x0;

        VPSS_CLK_CTRL   = 0x00000004;

        VPFE_CCDCFG     = 0x00000000;
        VPFE_FMTCFG     = 0x0000E000;       // Send bits 9-0 to preview engine
        VPFE_FMT_HORZ   = width;
        VPFE_FMT_VERT   = height;
        VPFE_VP_OUT     = (height-1)<<17 | (width)<<4;
        VPFE_FMT_ADDR0  = 0;
        VPFE_FMT_ADDR1  = 0;
        VPFE_FMT_ADDR2  = 0;
        VPFE_FMT_ADDR3  = 0;
        VPFE_FMT_ADDR4  = 0;
        VPFE_FMT_ADDR5  = 0;
        VPFE_FMT_ADDR6  = 0;
        VPFE_FMT_ADDR7  = 0;
        VPFE_PRGEVEN_0  = 0;
        VPFE_PRGEVEN_1  = 0;
        VPFE_PRGODD_0   = 0;
        VPFE_PRGODD_1   = 0;
     
        VPFE_PCR        = 0x00000001;   // Enable CCD Controller Engine

    Thanks for helping with this!!

  • What is the exact format coming out of CCDC? What is the exact format coming out of PREVIEWER? Have you configured format type in CCDC and PREVIEWER correctly?

  • Looking at specs, I see that previewer takes max of 10 bit data as input. I think you are feeding 14 bit data. Can you check that?

  • The CCDC allow you to store 14 bits of data to SDRAM then choose which 10 bits to send on to the Preview Engine.  I beleive I did that correctly.

    The CCDC output format is 320x256, 14 bits, grayscale.

    The output of the preview Engine is 318x256, 8 bits, grayscale.