Post Go back to editing

ADV7182A Init and strange images

Hi,

My custom board has ADV7182 to get images from two cameras and decode to my microcontroller. I've configured by I2C the init in "Free Run Mode" and in "Colors Bar Mode". In free run mode I could see that the images showed in LCD has relation to camera movements, but fully abstract. In colors bar mode I could see some pixels coloured, but without synchronization.

This I could get.

I followed the instructions from "5340.ADV7182RSD_revC" and "ADV7182CUST-VER.5.0.txt".

Any suggestion?

Thanks.

  • Hi,

     Please make sure this from your side - ADV7182 requires a 28.63636 MHz clock input in order to operate correctly. This clock input can be supplied from either an external crystal or an external oscillator device.

     Could you please share your register dump?

    Note: When the DEF_VAL_ AUTO_EN bit is 0, the ADV7182 outputs noise if it cannot decode the input video. It is recommended that the user keep DEF_VAL_AUTO_EN set to 1. And also crosscheck with below things,

     

    Thanks,

    Poornima

  • Hi ,

    Thanks for reply. The external crystal is ok, when I send (0x13,0x00) to enable external 28.63636MHz I checked with osciloscope and is oscillating.

    My registers init you can find below:

      ADV7182_Write(0x0F, 0x80);			/* Resets device */
      Delay_ms(20);
      ADV7182_Write(0x0F, 0x00);			/* Exit Power Down Mode */
      ADV7182_Write(0x13, 0x00);			/* Select 28.63636 MHz Clock Input */
      ADV7182_Write(0x52, 0xCD);			/* Set optimized IBIAS for AFE in Single Ended CVBS Format */
    
      /* Set for Free Run mode */
      ADV7182_Write(0x00, 0x05);				/* Select AIN1 as INPUT */
      ADV7182_Write(0x0C, 0x37);
      ADV7182_Write(0x14, 0x10);
      ADV7182_Write(0x02, 0x84);
    
      /* ADI Steps */
      ADV7182_Write(0x0E, 0x80);				/* ADI Required Write; Reset Current Clamp Circuitry (step 1) */
      ADV7182_Write(0x9C, 0x00);				/* ADI Required Write; Reset Current Clamp Circuitry (step 2) */
      ADV7182_Write(0x9C, 0xFF);				/* ADI Required Write; Reset Current Clamp Circuitry (step 3) */
      ADV7182_Write(0x0E, 0x00);				/* ADI Required Write; Reset Current Clamp Circuitry (step 4) */
    
      /* Fast Switch Mode was skipped */
    
      ADV7182_Write(0x17, 0x41	);				/* Select SH1 Chroma Shaping Filter */
      ADV7182_Write(0x03, 0x0C);				/* Enable Pixel & Sync output drivers */
      ADV7182_Write(0x04, 0x07);				/* Power-up INTRQ, HS and VS/FIELD/SFL pad */
      ADV7182_Write(0x1D, 0x40);				/* Enable LLC Output Driver */

    This configuration is to show a Blue screen to eliminate camera variable, so testing ADV7182 -> microcontroller -> TFT.

    About DEF_VAL_ AUTO_EN I kept the value set.

    Thanks.

  • Hi,

     You can able to see any signals on Hs/Vs/Field Pins of ADV7182A?

    Thanks,

    Poornima

  • Hi,

    Yes, in VS pin I have a square wave with 40ms of period.

    In HS pin I have pulses each 64us.

    Is it ok?

    Thanks.

  • Hi,

     As per CEA-861 spec, Please make sure whether you can able to read the proper timing parameter(HFreq,VFreq) w.r.t your input format.

    Thanks,

    Poornima

  • Hi

    Thanks for reply.

    In free run mode, for example when I want to show a Blue screen t or colors bars, what is the resolution of this image that ADV7182 send?

    I found the problem, it is my conversion from YCbCr to RGB888 format.

    Regards.

  • Hi,

     You can show either in blue screen or color bar depends on your requirement.But by default Cr/Cb gives blue screen output in freerun mode.  Default resolution - 480p.

     And also using VID_SEL[3:0] bits can be used to force the video standard output in free-run mode  - See the Video Standard Selection section.

     Please let me know, why this conversation in freerun "I found the problem, it is my conversion from YCbCr to RGB888 format." ?

    Thanks,

    Poornima

  • Hi ,

    About the conversion from YCbCr to RGB888 I had a problem in my algorithm, so I could fix it. My microcontroller reads the video decoder in YCbCr format and my display is in RGB888, so a mannualy conversion is necessary.

    Well I have a region of the memory were I write all receive data from ADV7182A, after I convert this data to RGB888 and copy to my framebuffer. If I write the region of memory in YCbCr format for example to have line bars colors, after it works, so my conversion is ok.

    But when I read from ADV7182 in the feature "Colors Bars Mode" I have the below screen. It seems like I have a bad synchronization in horizontal pixels.

    How many pixels does ADV7182 send in a line? I couldn't find it in datasheet and this basic working I don't have very clear.

    Thanks.

  • Hi,

    Let me clarify few things below,

     Are you trying to convert YCbCr to RGB888 format in ADV7182?

     Above shared image is free run colorbar output?

    Thanks,

    Poornima

  • Hi

    Are you trying to convert YCbCr to RGB888 format in ADV7182?

    No, this I do in my microcontroller. If there is anyway to do this in ADV7182 would be great, but datasheet only shows YCrCb 4:2:2 output.

    I have this:

    (Camera) -> (ADV7182) YCbCr -> (Microcontroller)- YCbCr  -> ( Memory) YCbCr-> (Conversion to RGB) RGB888 -> (Memory) RGB888 -> (TFT )

    Above shared image is free run colorbar output?

    Yes, I set ADV7182 to output colors bar to test all my setup.

    Hope that I could clarify my setup.

    Regards.