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.

AM37X processor setup with interlaced video frame

Other Parts Discussed in Thread: AM3703, STRIKE

Hi,

I am setting up the CSI2 interface on AM3703 to communicate with a backup camera through the analog ADV7280M device. I am trying to set it up so that the CSI2 will receive the interlaced signal and the CSI2 receiver will convert the interlaced signal to progressive frame (through DMA buffer). I got it mostly working. However, the two sides of the image is not displaying properly. Attached photo shows what it looks like. The pixel input is 720x253 for Even frame and 720x254 for Odd frames. CSI2_CTx_DAT_OFST is set to  (720x2). I did tried to set CSI2_CTx_DAT_OFST to 0 and I don't see the unwanted lines on the side so it seems like to me the ADV7280M sends the interlaced signal in properly. Can someone give me advice on what could be wrong?   

Thanks

Augustine

  • Hi,

    I will ask the factory team to have a look at this.
  • Hi Augustine,

    In your case the proper value for CSI2_CTx_DAT_OFST[15:5] OFST bit field is 0 because the data is written contiguously in memory. For more details check the AM/DM37xx TRM section 6.5.4.3 Camera ISP CSI2 Enable Video/Picture Acquisition.

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Thanks for your response. I did tried to set CSI2_CTx_DAT_OFST[15:5] OFST to 0. While I don't see the artifact on the both sides, I only got 50% of the frame height so it won't work for me.

    Thanks

    Augustine

  • Augustine Miu said:
    However, the two sides of the image is not displaying properly. Attached photo shows what it looks like. The pixel input is 720x253 for Even frame and 720x254 for Odd frames. CSI2_CTx_DAT_OFST is set to  (720x2)

    What is the precise hex value that is loaded into the CSI2_CTx_DAT_OFST register?  I see a couple possible mistakes that could be made here:

    1. Bits 4:0 of the register are reserved.  Did you left-shift your offset value by 5 to align it properly with the "OFST" bitfield (bits 16:5)?
    2. How many bits/pixel?  The 720x2 number would be correct for 1 byte/pixel.

    Can you also share the value programmed into the CSI2_CTx_DAT_PING_ADDR and CSI2_CTx_DAT_PONG_ADDR registers?

  • Thanks Brad,
    1) the hex value I put in the CSI2_CTx_DAT_OFST is 0x5A0. When I did the screen capture, I didn't left shift the value. Having said that, I did left shift the value by 5 before and it cause a dataabort. That's why I don't think I need to left shift the value. I just need to make sure bit 5:0 is all 0's so that it's 32 byte aligned.
    2) We use 16 bits/pixel. I thought 720x2 would means 720 Byte x 2 which would give me 2 byte/pixel. Did I misunderstand something here?

    Thanks
    Augustine
  • Augustine Miu said:
    1) the hex value I put in the CSI2_CTx_DAT_OFST is 0x5A0. When I did the screen capture, I didn't left shift the value. Having said that, I did left shift the value by 5 before and it cause a dataabort. That's why I don't think I need to left shift the value. I just need to make sure bit 5:0 is all 0's so that it's 32 byte aligned.

    Sorry, you're right.  I'll strike out my earlier comment.  It should not be left-shifted.  You just need to ensure it's a multiple of 32 bytes.

    Augustine Miu said:
    2) We use 16 bits/pixel. I thought 720x2 would means 720 Byte x 2 which would give me 2 byte/pixel. Did I misunderstand something here?

    The distance measured here is from the start of one line to the start of the next line.  Since you have two bytes per pixel that means you have 720x2 bytes between lines.  However, in order to deinterlace you want to SKIP every other line.  Therefore you need to have 720x2x2 as the stride length.  You should also have the PING address set to the start of the frame (line 0) and the PONG address set to line 1.

  • Good to know. At this point, I had PING = PONG cause I don't need double buffering. I will give this a try when I have a chance. Thanks
  • Hi Brad,

    I modify the value to what you recommended (both the PONG address and the OFST) and the video got a greenish color to it. I think the greenish colour is because it's not filling every single line. I think what you said make sense. Can you think of something else that I did wrong? 

    Thanks

    Augustine

  • Can you provide a dump of your camera values?  The image looks like it has stripes.  Can you tell how many pixels tall each stripe is?  (Not sure if that will give us a clue...)

    Augustine Miu said:
    I think the greenish colour is because it's not filling every single line.

    What do you mean we're not filling every line?  The first field should be used to fill the even lines and the second field should be used to fill all the odd lines.  So in aggregate between the two fields the entire frame should be filled.