ADV7842 CVBS to RGB Out

I've been using the AVES scripts for the ADV7842/AD7511 eval board to successfully setup up my custom ADV7842 board to handle analog RGB inputs.  I've moved onto CVBS (NTSC) inputs and I'm not having the same success.  I started with the 1-1e script (NTSC to 480i HDMI) and I was able to get video out of my board but the colors where all messed up.  Specifically, black is coming out as purple and white is coming out as a lime color.  As I dug into it I saw the script sets up the ADV7511 to accept YCrCb so the ADV7842 must output YCrCb.  However, the DVI Transmitter on my board only accepts RGB so I need the ADV7842 to output RGB as it did with the analog RGB input scripts.  I thought that should be as simple as switching 0x40 (IO) 0x02[1] from '0' to '1' but that seemed to have no impact.  I realize the analog RGB inputs use CP and the CVBS inputs use SDP but other than the register I just mentioned I don't see anything related to SDP color output specifically.

I've been analyzing scripts all day and I can't seem to figure out why the analog RGB input scripts work but the CVBS input scripts don't.  Do you have any ideas or things for me to check that might help me diagnose because I'm pretty stumped?

By the way, I tried disabling the 3D comb filter to take the SDRAM on my board out of the equation and it didn't resolve my issue.

Thanks,

Nathan

Parents
  • 0
    •  Analog Employees 
    on Aug 5, 2011 11:49 PM over 8 years ago

    Kevin, that script worked for me.

    FYI, I found an error in the math for the SDP CSC example in the Hardware Manual for the ADV7842.  Lead to some of my confusion.  Specifically on page 168, SDP_A3 uses wrong coeffiicent and SDP_C3 has bad math.  Both problems lead to bad hex values.

  • Hello,

    I'm trying to get a NTSC 60Hz interlaced signal on CVBS convert it to progressive and get it at 24 bit 4:4:4 RGB.

    I'm working with this script:

    sudo i2cset -y 8 0x20 0xff 0xff #full reset
    sudo i2cset -y 8 0x20 0xf1 0x90 #SDP map
    sudo i2cset -y 8 0x20 0xf2 0x94 #SDPIO map
    sudo i2cset -y 8 0x20 0xf3 0x84 #AVLINK
    sudo i2cset -y 8 0x20 0xf4 0x80 #CEC
    sudo i2cset -y 8 0x20 0xf5 0x7c #INFOFRAME
    sudo i2cset -y 8 0x20 0xf8 0x4c #AFE
    sudo i2cset -y 8 0x20 0xf9 0x64 #KSV
    sudo i2cset -y 8 0x20 0xfa 0x6c #EDID
    sudo i2cset -y 8 0x20 0xfb 0x68 #HDMI
    sudo i2cset -y 8 0x20 0xfd 0x44 #CP
    sudo i2cset -y 8 0x20 0xfe 0x48 #VDP
    sudo i2cset -y 8 0x20 0x00 0x01 #VID_STD = SD 4x1 720x480i/576i CVBS
    sudo i2cset -y 8 0x20 0x01 0x00 #V_FREQ = 60Hz, PRIM_MODE = SDP Mode
    #sudo i2cset -y 8 0x20 0x02 0xF2 #RGB color space output
    sudo i2cset -y 8 0x20 0x03 0x4c #24-bit SDR 4:4:4 mode 3 out
    sudo i2cset -y 8 0x20 0x04 0x62 #op_ch_sel = 3
    sudo i2cset -y 8 0x20 0x0c 0x40 #power up all blocks
    sudo i2cset -y 8 0x20 0x15 0x90 #power up pads, Audio out = tristate
    sudo i2cset -y 8 0x20 0x19 0xC3 #LLC_DLL_EN = 1 LLC_DLL_DOUBLE = 1 DLL_PHASE = 0x03
    sudo i2cset -y 8 0x20 0x33 0x40 #LLC_DLL_MUX = 1
    sudo i2cset -y 8 0x20 0xde 0x90 #Manual 27Mhz output clock (undocumented)
    sudo i2cset -y 8 0x26 0x0c 0x1f #ADI recommended write
    sudo i2cset -y 8 0x26 0x12 0x63 #ADI recommended write
    sudo i2cset -y 8 0x26 0x00 0x0e #ADC0 power Up
    sudo i2cset -y 8 0x26 0x02 0x80 #Manual Mux
    sudo i2cset -y 8 0x26 0x03 0xb0 #Ain11
    sudo i2cset -y 8 0x4a 0x7a 0xa5 #Timing Adjustment 
    sudo i2cset -y 8 0x4a 0x7b 0x8f #Timing Adjustment
    sudo i2cset -y 8 0x4a 0x60 0x01 #SDRAM reset
    sudo i2cset -y 8 0x4a 0x97 0x00 #Hsync width Adjustment Adjustment
    sudo i2cset -y 8 0x4a 0xb2 0x60 #Disable AV codes
    sudo i2cset -y 8 0x48 0x00 0x7f #Autodetect PAL NTSC SECAM
    sudo i2cset -y 8 0x48 0x01 0x00 #Pedestal Off
    sudo i2cset -y 8 0x48 0x03 0xe4 #Manual VCR Gain Luma 0x40B
    sudo i2cset -y 8 0x48 0x04 0x0b #Manual Luma setting
    sudo i2cset -y 8 0x48 0x05 0xc3 #Manual Chroma setting 0x3FE
    sudo i2cset -y 8 0x48 0x06 0xfe #Manual Chroma setting
    sudo i2cset -y 8 0x48 0x12 0x09 #enable I2P, disable TBC, enable 3D comb.
    sudo i2cset -y 8 0x48 0xa7 0x00 #ADI Recommended Write
    #colorspace conversion NTSC to RGB:
    sudo i2cset -y 8 0x4A 0xB0 0x00 # Disable H and v blanking
    sudo i2cset -y 8 0x4A 0xE0 0x83 # Manual CSC mode CSC scaler = 2 A1[12:8]
    sudo i2cset -y 8 0x4A 0xE1 0xA7 # CSC coeff A1[7:0]
    sudo i2cset -y 8 0x4A 0xE2 0x1E # CSC coeff A2[12:8]
    sudo i2cset -y 8 0x4A 0xE3 0x91 # CSC coeff A2[7:0]
    sudo i2cset -y 8 0x4A 0xE4 0x1D # CSC coeff A3[12:8]
    sudo i2cset -y 8 0x4A 0xE5 0xE2 # CSC coeff A3[7:0]
    sudo i2cset -y 8 0x4A 0xE6 0x7D # CSC coeff A4[14:8]
    sudo i2cset -y 8 0x4A 0xE7 0x00 # CSC coeff A4[7:0]
    sudo i2cset -y 8 0x4A 0xE8 0x03 # CSC coeff B1[12:8]
    sudo i2cset -y 8 0x4A 0xE9 0xA7 # CSC coeff B1[7:0]
    sudo i2cset -y 8 0x4A 0xEA 0x07 # CSC coeff B2[12:8]
    sudo i2cset -y 8 0x4A 0xEB 0x61 # CSC coeff B2[7:0]
    sudo i2cset -y 8 0x4A 0xEC 0x00 # CSC coeff B3[12:8]
    sudo i2cset -y 8 0x4A 0xED 0x00 # CSC coeff B3[7:0]
    sudo i2cset -y 8 0x4A 0xEE 0x79 # CSC coeff B4[14:8]
    sudo i2cset -y 8 0x4A 0xEF 0x00 # CSC coeff B4[7:0]
    sudo i2cset -y 8 0x4A 0xF0 0x03 # CSC coeff C1[12:8]
    sudo i2cset -y 8 0x4A 0xF1 0xA7 # CSC coeff C1[7:0]
    sudo i2cset -y 8 0x4A 0xF2 0x00 # CSC coeff C2[12:8]
    sudo i2cset -y 8 0x4A 0xF3 0x00 # CSC coeff C2[7:0]
    sudo i2cset -y 8 0x4A 0xF4 0x04 # CSC coeff C3[12:8]
    sudo i2cset -y 8 0x4A 0xF5 0x29 # CSC coeff C3[7:0]
    sudo i2cset -y 8 0x4A 0xF6 0x79 # CSC coeff C4[14:8]
    sudo i2cset -y 8 0x4A 0xF7 0x00 # CSC coeff C4[7:0]

    I followed all tips of this topic, and the better image I can get was:

    I think it's almost done, but some gray tones becomes pink or something like that.

    Can anyone adjust my script to do this conversion correctly?

    Thanks!

  • Hi,

    I turned off the csc and tested all values to 0x02 (INP_COLOR_SPACE) register from 0 to 7, with the same results:

    tThe register 0x53 from HDMI returns 0x00 but the input is CVBS, HDMI block can do something in this configuration?

  • 0
    •  Analog Employees 
    on Jun 30, 2020 2:17 PM 1 month ago in reply to alfredo

    Hi,

     Please try to change the CSC setting as auto and check automatic CSC for the SDP path.
     SDP_CSC_AUTO to 0 for manual and 1 for automatic.

    Thanks,

    Poornima

  • It's already turned off, if I turn it on the image goes to a almost dark image with some pink spots.

  • 0
    •  Analog Employees 
    on Jul 1, 2020 9:14 AM 1 month ago in reply to alfredo

    Hi,

     As i already stated 'ADV7842 is an basically a serial to parallel converter(even for analog input), what comes in goes out".
    Is it possible you to check the output of ADV7842 ? To confirm whether the problem is from either ADV7842 or Processor side.

    Thanks,

    Poornima

  • Hi,

    I have two of these ADV7842 on my board, with the same chain (ADV7842 -> isolation -> TFP410 -> ADV7482 -> TX2) these IC are u43 and u53.

    The diference is the input:

    U43 has DVI and CVBS inputs conected

    U53 has DVI and VGA inputs conected

    On u53 I can get a XGA input through vga port with correct colors.

    Now I'm trying to get CVBS input working on u43, but I'm getting the problems above...

    Trying to test if all is correct on chain after ADV7842's ic's I generate colorbars on both u43 and u53, but the result are different:

    Left = u43

    Right = u53

    The script I used is the "best" I have until now:

    sudo i2cset -y 8 0x20 0xff 0xff #full reset
    sudo i2cset -y 8 0x20 0xf1 0x90 #SDP map
    sudo i2cset -y 8 0x20 0xf2 0x94 #SDPIO map
    sudo i2cset -y 8 0x20 0xf3 0x84 #AVLINK
    sudo i2cset -y 8 0x20 0xf4 0x80 #CEC
    sudo i2cset -y 8 0x20 0xf5 0x7c #INFOFRAME
    sudo i2cset -y 8 0x20 0xf8 0x4c #AFE
    sudo i2cset -y 8 0x20 0xf9 0x64 #KSV
    sudo i2cset -y 8 0x20 0xfa 0x6c #EDID
    sudo i2cset -y 8 0x20 0xfb 0x68 #HDMI
    sudo i2cset -y 8 0x20 0xfd 0x44 #CP
    sudo i2cset -y 8 0x20 0xfe 0x48 #VDP
    sudo i2cset -y 8 0x20 0x00 0x01 #VID_STD = SD 4x1 720x480i/576i CVBS
    sudo i2cset -y 8 0x20 0x01 0x00 #V_FREQ = 60Hz, PRIM_MODE = SDP Mode
    #sudo i2cset -y 8 0x20 0x02 0xF2 #RGB color space output
    sudo i2cset -y 8 0x20 0x03 0x4c #24-bit SDR 4:4:4 mode 3 out
    sudo i2cset -y 8 0x20 0x04 0x62 #op_ch_sel = 3
    sudo i2cset -y 8 0x20 0x0c 0x40 #power up all blocks
    sudo i2cset -y 8 0x20 0x15 0x90 #power up pads, Audio out = tristate
    sudo i2cset -y 8 0x20 0x19 0xC3 #LLC_DLL_EN = 1 LLC_DLL_DOUBLE = 1 DLL_PHASE = 0x03
    sudo i2cset -y 8 0x20 0x33 0x40 #LLC_DLL_MUX = 1
    #sudo i2cset -y 8 0x20 0xde 0x90 #Manual 27Mhz output clock (undocumented)
    sudo i2cset -y 8 0x26 0x0c 0x1f #ADI recommended write
    sudo i2cset -y 8 0x26 0x12 0x63 #ADI recommended write
    sudo i2cset -y 8 0x26 0x00 0x0e #ADC0 power Up
    sudo i2cset -y 8 0x26 0x02 0x80 #Manual Mux
    sudo i2cset -y 8 0x26 0x03 0xb0 #Ain11
    sudo i2cset -y 8 0x4a 0x7a 0xa5 #Timing Adjustment 
    sudo i2cset -y 8 0x4a 0x7b 0x8f #Timing Adjustment
    sudo i2cset -y 8 0x4a 0x60 0x01 #SDRAM reset
    sudo i2cset -y 8 0x4a 0x97 0x00 #Hsync width Adjustment Adjustment
    sudo i2cset -y 8 0x4a 0xb2 0x60 #Disable AV codes
    sudo i2cset -y 8 0x48 0x00 0x7f #Autodetect PAL NTSC SECAM
    sudo i2cset -y 8 0x48 0x01 0x00 #Pedestal Off
    sudo i2cset -y 8 0x48 0x03 0xe4 #Manual VCR Gain Luma 0x40B
    sudo i2cset -y 8 0x48 0x04 0x0b #Manual Luma setting
    sudo i2cset -y 8 0x48 0x05 0xc3 #Manual Chroma setting 0x3FE
    sudo i2cset -y 8 0x48 0x06 0xfe #Manual Chroma setting
    sudo i2cset -y 8 0x48 0x12 0x09 #enable I2P, disable TBC, enable 3D comb.
    sudo i2cset -y 8 0x48 0xa7 0x00 #ADI Recommended Write
    #colorspace conversion NTSC to RGB:
    sudo i2cset -y 8 0x4A 0xB0 0x00 # Disable H and v blanking
    sudo i2cset -y 8 0x4A 0xE0 0x83 # Manual CSC mode CSC scaler = 2 A1[12:8]
    sudo i2cset -y 8 0x4A 0xE1 0xA7 # CSC coeff A1[7:0]
    sudo i2cset -y 8 0x4A 0xE2 0x1E # CSC coeff A2[12:8]
    sudo i2cset -y 8 0x4A 0xE3 0x91 # CSC coeff A2[7:0]
    sudo i2cset -y 8 0x4A 0xE4 0x1D # CSC coeff A3[12:8]
    sudo i2cset -y 8 0x4A 0xE5 0xE2 # CSC coeff A3[7:0]
    sudo i2cset -y 8 0x4A 0xE6 0x7D # CSC coeff A4[14:8]
    sudo i2cset -y 8 0x4A 0xE7 0x00 # CSC coeff A4[7:0]
    sudo i2cset -y 8 0x4A 0xE8 0x03 # CSC coeff B1[12:8]
    sudo i2cset -y 8 0x4A 0xE9 0xA7 # CSC coeff B1[7:0]
    sudo i2cset -y 8 0x4A 0xEA 0x07 # CSC coeff B2[12:8]
    sudo i2cset -y 8 0x4A 0xEB 0x61 # CSC coeff B2[7:0]
    sudo i2cset -y 8 0x4A 0xEC 0x00 # CSC coeff B3[12:8]
    sudo i2cset -y 8 0x4A 0xED 0x00 # CSC coeff B3[7:0]
    sudo i2cset -y 8 0x4A 0xEE 0x79 # CSC coeff B4[14:8]
    sudo i2cset -y 8 0x4A 0xEF 0x00 # CSC coeff B4[7:0]
    sudo i2cset -y 8 0x4A 0xF0 0x03 # CSC coeff C1[12:8]
    sudo i2cset -y 8 0x4A 0xF1 0xA7 # CSC coeff C1[7:0]
    sudo i2cset -y 8 0x4A 0xF2 0x00 # CSC coeff C2[12:8]
    sudo i2cset -y 8 0x4A 0xF3 0x00 # CSC coeff C2[7:0]
    sudo i2cset -y 8 0x4A 0xF4 0x04 # CSC coeff C3[12:8]
    sudo i2cset -y 8 0x4A 0xF5 0x29 # CSC coeff C3[7:0]
    sudo i2cset -y 8 0x4A 0xF6 0x79 # CSC coeff C4[14:8]
    sudo i2cset -y 8 0x4A 0xF7 0x00 # CSC coeff C4[7:0]

    And to change it to color bars:

    sudo i2cset -y 8 0x48 0xDD 0XBF

    Now, if I change the CSC values or turn it on or off it has no effect on color bars.

    My questions are:

    1 - Do you know if the color bars are generated after CSC?

    2 - How can I know if the ADV7842 is generating color-bar output in RGB 4:4:4 with 8 bit per color?

    Thanks

Reply
  • Hi,

    I have two of these ADV7842 on my board, with the same chain (ADV7842 -> isolation -> TFP410 -> ADV7482 -> TX2) these IC are u43 and u53.

    The diference is the input:

    U43 has DVI and CVBS inputs conected

    U53 has DVI and VGA inputs conected

    On u53 I can get a XGA input through vga port with correct colors.

    Now I'm trying to get CVBS input working on u43, but I'm getting the problems above...

    Trying to test if all is correct on chain after ADV7842's ic's I generate colorbars on both u43 and u53, but the result are different:

    Left = u43

    Right = u53

    The script I used is the "best" I have until now:

    sudo i2cset -y 8 0x20 0xff 0xff #full reset
    sudo i2cset -y 8 0x20 0xf1 0x90 #SDP map
    sudo i2cset -y 8 0x20 0xf2 0x94 #SDPIO map
    sudo i2cset -y 8 0x20 0xf3 0x84 #AVLINK
    sudo i2cset -y 8 0x20 0xf4 0x80 #CEC
    sudo i2cset -y 8 0x20 0xf5 0x7c #INFOFRAME
    sudo i2cset -y 8 0x20 0xf8 0x4c #AFE
    sudo i2cset -y 8 0x20 0xf9 0x64 #KSV
    sudo i2cset -y 8 0x20 0xfa 0x6c #EDID
    sudo i2cset -y 8 0x20 0xfb 0x68 #HDMI
    sudo i2cset -y 8 0x20 0xfd 0x44 #CP
    sudo i2cset -y 8 0x20 0xfe 0x48 #VDP
    sudo i2cset -y 8 0x20 0x00 0x01 #VID_STD = SD 4x1 720x480i/576i CVBS
    sudo i2cset -y 8 0x20 0x01 0x00 #V_FREQ = 60Hz, PRIM_MODE = SDP Mode
    #sudo i2cset -y 8 0x20 0x02 0xF2 #RGB color space output
    sudo i2cset -y 8 0x20 0x03 0x4c #24-bit SDR 4:4:4 mode 3 out
    sudo i2cset -y 8 0x20 0x04 0x62 #op_ch_sel = 3
    sudo i2cset -y 8 0x20 0x0c 0x40 #power up all blocks
    sudo i2cset -y 8 0x20 0x15 0x90 #power up pads, Audio out = tristate
    sudo i2cset -y 8 0x20 0x19 0xC3 #LLC_DLL_EN = 1 LLC_DLL_DOUBLE = 1 DLL_PHASE = 0x03
    sudo i2cset -y 8 0x20 0x33 0x40 #LLC_DLL_MUX = 1
    #sudo i2cset -y 8 0x20 0xde 0x90 #Manual 27Mhz output clock (undocumented)
    sudo i2cset -y 8 0x26 0x0c 0x1f #ADI recommended write
    sudo i2cset -y 8 0x26 0x12 0x63 #ADI recommended write
    sudo i2cset -y 8 0x26 0x00 0x0e #ADC0 power Up
    sudo i2cset -y 8 0x26 0x02 0x80 #Manual Mux
    sudo i2cset -y 8 0x26 0x03 0xb0 #Ain11
    sudo i2cset -y 8 0x4a 0x7a 0xa5 #Timing Adjustment 
    sudo i2cset -y 8 0x4a 0x7b 0x8f #Timing Adjustment
    sudo i2cset -y 8 0x4a 0x60 0x01 #SDRAM reset
    sudo i2cset -y 8 0x4a 0x97 0x00 #Hsync width Adjustment Adjustment
    sudo i2cset -y 8 0x4a 0xb2 0x60 #Disable AV codes
    sudo i2cset -y 8 0x48 0x00 0x7f #Autodetect PAL NTSC SECAM
    sudo i2cset -y 8 0x48 0x01 0x00 #Pedestal Off
    sudo i2cset -y 8 0x48 0x03 0xe4 #Manual VCR Gain Luma 0x40B
    sudo i2cset -y 8 0x48 0x04 0x0b #Manual Luma setting
    sudo i2cset -y 8 0x48 0x05 0xc3 #Manual Chroma setting 0x3FE
    sudo i2cset -y 8 0x48 0x06 0xfe #Manual Chroma setting
    sudo i2cset -y 8 0x48 0x12 0x09 #enable I2P, disable TBC, enable 3D comb.
    sudo i2cset -y 8 0x48 0xa7 0x00 #ADI Recommended Write
    #colorspace conversion NTSC to RGB:
    sudo i2cset -y 8 0x4A 0xB0 0x00 # Disable H and v blanking
    sudo i2cset -y 8 0x4A 0xE0 0x83 # Manual CSC mode CSC scaler = 2 A1[12:8]
    sudo i2cset -y 8 0x4A 0xE1 0xA7 # CSC coeff A1[7:0]
    sudo i2cset -y 8 0x4A 0xE2 0x1E # CSC coeff A2[12:8]
    sudo i2cset -y 8 0x4A 0xE3 0x91 # CSC coeff A2[7:0]
    sudo i2cset -y 8 0x4A 0xE4 0x1D # CSC coeff A3[12:8]
    sudo i2cset -y 8 0x4A 0xE5 0xE2 # CSC coeff A3[7:0]
    sudo i2cset -y 8 0x4A 0xE6 0x7D # CSC coeff A4[14:8]
    sudo i2cset -y 8 0x4A 0xE7 0x00 # CSC coeff A4[7:0]
    sudo i2cset -y 8 0x4A 0xE8 0x03 # CSC coeff B1[12:8]
    sudo i2cset -y 8 0x4A 0xE9 0xA7 # CSC coeff B1[7:0]
    sudo i2cset -y 8 0x4A 0xEA 0x07 # CSC coeff B2[12:8]
    sudo i2cset -y 8 0x4A 0xEB 0x61 # CSC coeff B2[7:0]
    sudo i2cset -y 8 0x4A 0xEC 0x00 # CSC coeff B3[12:8]
    sudo i2cset -y 8 0x4A 0xED 0x00 # CSC coeff B3[7:0]
    sudo i2cset -y 8 0x4A 0xEE 0x79 # CSC coeff B4[14:8]
    sudo i2cset -y 8 0x4A 0xEF 0x00 # CSC coeff B4[7:0]
    sudo i2cset -y 8 0x4A 0xF0 0x03 # CSC coeff C1[12:8]
    sudo i2cset -y 8 0x4A 0xF1 0xA7 # CSC coeff C1[7:0]
    sudo i2cset -y 8 0x4A 0xF2 0x00 # CSC coeff C2[12:8]
    sudo i2cset -y 8 0x4A 0xF3 0x00 # CSC coeff C2[7:0]
    sudo i2cset -y 8 0x4A 0xF4 0x04 # CSC coeff C3[12:8]
    sudo i2cset -y 8 0x4A 0xF5 0x29 # CSC coeff C3[7:0]
    sudo i2cset -y 8 0x4A 0xF6 0x79 # CSC coeff C4[14:8]
    sudo i2cset -y 8 0x4A 0xF7 0x00 # CSC coeff C4[7:0]

    And to change it to color bars:

    sudo i2cset -y 8 0x48 0xDD 0XBF

    Now, if I change the CSC values or turn it on or off it has no effect on color bars.

    My questions are:

    1 - Do you know if the color bars are generated after CSC?

    2 - How can I know if the ADV7842 is generating color-bar output in RGB 4:4:4 with 8 bit per color?

    Thanks

Children