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.

TVP7002 RGB TO YPBPR

Other Parts Discussed in Thread: TVP7002

 

     We connected TVP7002 to DM6467. Now the VESA(1280x720x60@R,G,B) video was converted by TVP7002 to 4:2:2 YCbCr data.
We now found a problem about RGB2YCbCr mode.
The "green" seems "black"
The "blue" is very "blue"
The "white" is also ok
The "red" seems "orange"

The parameter we used is as follow:

    errors |= tvp7002_rset( 0x2a, 0x07 );   // Enable FINE CLAMP CONTROL
    errors |= tvp7002_rset( 0x10, 0x58 );   // SOG Threshold-(YPbPr Clamp)  //change for csc
    errors |= tvp7002_rset( 0x15, 0x23 );   // Output Formatter, 64-960, embedded syncs
    errors |= tvp7002_rset( 0x18, 0x10 );   // T-SW disabled, blank off, CSC enable, FID, SOG, CLK polarity=invert


//for csc convert. all are defult value
    errors |= tvp7002_rset( 0x08, 0x00 );   // ADD FOR VESA BLUE GAIN
    errors |= tvp7002_rset( 0x09, 0x00 );   // ADD FOR VESA GREEN GAIN
    errors |= tvp7002_rset( 0x0A, 0x00 );   // ADD FOR VESA RED GAIN

    errors |= tvp7002_rset( 0x0B, 0x80 );   // ADD FOR VESA B OFFSET
    errors |= tvp7002_rset( 0x0C, 0x80 );   // ADD FOR VESA G OFFSET
    errors |= tvp7002_rset( 0x0D, 0x80 );   // ADD FOR VESA R OFFSET

//y
    errors |= tvp7002_rset( 0x4A, 0xE3 );   // g
    errors |= tvp7002_rset( 0x4B, 0x16 );   // g

    errors |= tvp7002_rset( 0x4C, 0x4F );   // b
    errors |= tvp7002_rset( 0x4D, 0x02 );   // b

    errors |= tvp7002_rset( 0x4E, 0xCE );   // r
    errors |= tvp7002_rset( 0x4F, 0x06 );   // r
 //PB
    errors |= tvp7002_rset( 0x50, 0xAB );   // g
    errors |= tvp7002_rset( 0x51, 0xF3 );   // g

    errors |= tvp7002_rset( 0x52, 0x00 );   // b
    errors |= tvp7002_rset( 0x53, 0x10 );   // b

    errors |= tvp7002_rset( 0x54, 0x55 );   // r
    errors |= tvp7002_rset( 0x55, 0xFC );   // r
//PR

    errors |= tvp7002_rset( 0x56, 0x78 );   // g
    errors |= tvp7002_rset( 0x57, 0xF1 );   // g

    errors |= tvp7002_rset( 0x58, 0x88 );   // b
    errors |= tvp7002_rset( 0x59, 0xFE );   // b

    errors |= tvp7002_rset( 0x5A, 0x00 );   // r
    errors |= tvp7002_rset( 0x5B, 0x10 );   // r
   
I have tried to change some parameters. The color can be changed. But I still can't get the color I want.

 

 

Other register about TVP7002 is as follow. I think they have few relation about CSC.

    /* TVP7002 - 720p@60Hz- 45khz - 74.25Mhz - 20bit 4:2:2 - Embedded Syncs */
    errors |= tvp7002_rset( 0x01, 0x67 );   // PLL DIVMSB  1650
    errors |= tvp7002_rset( 0x02, 0x20 );   // PLL DIVLSB
    errors |= tvp7002_rset( 0x03, 0xa0 );   // VCO2_CP3_RR_CP_R
    errors |= tvp7002_rset( 0x04, 0x80 );   // PHASE SEL(5) CKDI CKDI DIV2

    errors |= tvp7002_rset( 0x05, 0x32 );   // CLAMP START
    errors |= tvp7002_rset( 0x06, 0x20 );   // CLAMP WIDTH

    errors |= tvp7002_rset( 0x07, 0x60 );   // HSYNC OUTPUT WIDTH - 96

    errors |= tvp7002_rset( 0x0e, 0x20 );   // SYNC CONTROL    HSout+

    errors |= tvp7002_rset( 0x0f, 0x2e );   // PLL and CLAMP CONTROL


    errors |= tvp7002_rset( 0x11, 0x47 );   // SYNC SEPERATOR THRESHOLD
    errors |= tvp7002_rset( 0x12, 0x01 );   // PRE_COAST
    errors |= tvp7002_rset( 0x13, 0x00 );   // POST_COAST
    errors |= tvp7002_rset( 0x15, 0x23 );   // Output Formatter, 64-960, embedded syncs //change for csc
    errors |= tvp7002_rset( 0x16, 0x11 );   // MISC Control


    errors |= tvp7002_rset( 0x17, 0x00 );   // Outputs enabled
    errors |= tvp7002_rset( 0x19, 0x00 );   // INPUT MUX SELECT    CH1 selected (BNC )

    errors |= tvp7002_rset( 0x1a, 0xC2 );   // SOG Filter(33Mhz) and CLP, INT REF CLK, INPUT MUX SELECT  HSYNC_A and VSYNC_A selected



    errors |= tvp7002_rset( 0x21, 0x08 );   // HSOUT START
    errors |= tvp7002_rset( 0x22, 0x00 );   // Macrovision support
    errors |= tvp7002_rset( 0x26, 0x80 );   // ALC Enable
    errors |= tvp7002_rset( 0x28, 0x53 );   // AL FILTER Control
    errors |= tvp7002_rset( 0x2a, 0x07 );   // Enable FINE CLAMP CONTROL

    errors |= tvp7002_rset( 0x2b, 0x00 );   // POWER CONTROL-SOG ON
    errors |= tvp7002_rset( 0x2c, 0x53 );   // ADC Setup
    errors |= tvp7002_rset( 0x2d, 0x00 );   // Coarse Clamp OFF
    errors |= tvp7002_rset( 0x2e, 0x80 );   // SOG Clamp ON
    errors |= tvp7002_rset( 0x31, 0x18 );   // ALC PLACEMENT
    errors |= tvp7002_rset( 0x3f, 0x01 );   // Input B/W
    errors |= tvp7002_rset( 0x40, 0x47 );   // AVID Start  327 (300+27)
    errors |= tvp7002_rset( 0x41, 0x01 );   // AVID Start
    errors |= tvp7002_rset( 0x42, 0x4b );   // AVID Stop  1611 (AVID start + 1280 + 4)
    errors |= tvp7002_rset( 0x43, 0x06 );   // AVID Stop


    errors |= tvp7002_rset( 0x44, 0x05 );   // VBLK F0 Offset
    errors |= tvp7002_rset( 0x45, 0x05 );   // VBLK F1 Offse
    errors |= tvp7002_rset( 0x46, 0x1a );   // VBLK F0 Duration
    errors |= tvp7002_rset( 0x47, 0x1a );   // VBLK F1 Duration

 

  • For the most part, the TVP7002 settings being used look okay.  You can try the settings below to position the clamp pulse before after the ALC placement.  This is typically preferred to prevent interaction between the clamp interval and the ALC (automatic level control) sampling window.  This could have slight impact on levels.  If the color level issue is severe, then it could be related to color processing elsewhere in the system.

    errors |= tvp7002_rset( 0x05, 0x06 );   // CLAMP START
    errors |= tvp7002_rset( 0x06, 0x10 );   // CLAMP WIDTH

    errors |= tvp7002_rset( 0x31, 0x18 );   // ALC PLACEMENT

    What type of monitor is being used to display the format?  When graphics formats are being displayed on a typical PC monitor, the postion of HSync alignment issue can create clamping and color levels issues in the monitor.  This is typically accompanied with incorrect horizontal alignment, however.   Similar issues can occur with the TVP7002 clamp operation, if the HSYNC input is not correctly postioned relative to the RGB inputs.

    You may also want check the RGB input format to make sure that HSYNC = 45KHz for the 1280x720 RGB input format.

  • Thanks.

    The reason of the color is "Channel GREEN is connected to GND because of the uncareful jointing"

  •  

    The VESA 1280x720x60 RGB input format must use the settings recommended for PC graphics.  Please try the settings below for this format.  These settings can be used for all RGB graphics setups.  Your settings sent used clamp position settings for HD inputs having tri-level syncs.

     errors |= tvp7002_rset( 0x05, 0x06 );   // CLAMP START
     errors |= tvp7002_rset( 0x06, 0x10 );   // CLAMP WIDTH

     errors |= tvp7002_rset( 0x31, 0x18 );   // ALC PLACEMENT

    The default gain and offset settings should produce good color.  Is PbPr color is swapped, the CbCr order bit in register 15h may be used to change the order.