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.

DS90UB954-Q1: MIPI Test Pattern is YUV422 8 bits or 10?

Part Number: DS90UB954-Q1

Hello,

I'm trying to interface the DS90UB954 to a reference design for a MIPI receiver supplied by Lattice in their ECP5 FPGA. Rather than trying to get the imager to send data through the Serdes and into the FPGA all at once (Tried and failed) I'm trying to just get a test pattern from the 954 to go into the Lattice part successfully.

If my PGEN_CSI_DI register is set to 0x1E should I be getting YUV422 8 bit or 10 bit format?

Also I want to make sure I'm not entering LP mode. If I set register bit 0x33[1] Continuous clock to 1 then I shouldn't enter LP mode right?

Finally I notice in the fixed colorbar pattern example (7.5.11.4 in the datasheet) the register 0x20 for forwarding is never enabled. Is this needed for the test pattern?

Thanks,

Vivek

  • Hello Vivek,

    0x1E corresponds to YUV422 8 bit, and 0x1F is for YUV422 10 bit. 

    For 0x33[1] = 1 continuous clock mode you are right, there will not be any LP states on the clock but the data lines will always transition back and forth between LP and HS which is normal. 

    If you are doing PATGEN from the SER, then you need forwarding, but if you are doing PATGEN from the DES then you do not need forwarding. Here is a script for YUV422 8 bit which has been verified before. This particular one generates the PATGEN from the remote SER and passes to the DES, but the code can be reworked to have the DES just generate the same pattern by itself.

    """
      Copyright 2018 Texas Instruments Incorporated. All rights reserved.
    
      IMPORTANT: Your use of this Software is limited to those specific rights
      granted under the terms of a software license agreement between the user who
      downloaded the software, his/her employer (which must be your employer) and
      Texas Instruments Incorporated (the "License"). You may not use this Software
      unless you agree to abide by the terms of the License. The License limits your
      use, and you acknowledge, that the Software may not be modified, copied or
      distributed unless embedded on a Texas Instruments microcontroller which is
      integrated into your product. Other than for the foregoing purpose, you may
      not use, reproduce, copy, prepare derivative works of, modify, distribute,
      perform, display or sell this Software and/or its documentation for any
      purpose.
    
      YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
      PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
      INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
      NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS
      INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
      NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL
      EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
      LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL
      DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS,
      TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
      LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
    
      Should you have any questions regarding your right to use this Software,
      contact Texas Instruments Incorporated at www.TI.com.
    
    """
    # Patgen YUV ColorBar 1280x800p60 on 953/954
    # Version 0.92
    
    import time
    
    # 953 config
    runTime = 3
    
    Alias953 = 0x18
    DES954 = 0x60
    
    
    # Reset 954
    board.WriteI2C(DES954, 0x01, 0x01)
    time.sleep(1.0)
    # CSI enable , continuous clock, 4 lanes
    board.WriteI2C(DES954, 0x33, 0x03)
    time.sleep(0.1)
    # Set CSI_TX_SPEED to select 400Mbps
    board.WriteI2C(DES954, 0x1F, 0x03)
    time.sleep(0.1)
    # Port Control - only Rx0
    board.WriteI2C(DES954, 0x0C, 0x01)
    time.sleep(0.1)
    # Port Selection - only Rx0
    board.WriteI2C(DES954, 0x4C, 0x01)
    time.sleep(0.1)
    # set alias
    board.WriteI2C(DES954, 0x5C, Alias953)
    time.sleep(0.1)
    board.WriteI2C(DES954, 0x20,0x20) # forwarding of all Rx0 to CSI0
    time.sleep(0.1)
    if (board.ReadI2C(Alias953, 0x00, 0x01) != 0x30):
    	print "953 ID Error"
    else:
    	print "953 ID Ok"
    
    # Reset 953
    board.WriteI2C(Alias953, 0x01, 0x01)
    time.sleep(1.0)	
    # enable pat gen
    board.WriteI2C(Alias953, 0xB0, 0x00)
    board.WriteI2C(Alias953, 0xB1, 0x01)
    board.WriteI2C(Alias953, 0xB2, 0x01) #enable pattern generator
    
    board.WriteI2C(Alias953, 0xB1, 0x02)
    board.WriteI2C(Alias953, 0xB2, 0x33) #fixed color pattern, 8 color bars, block size of 5
    
    board.WriteI2C(Alias953, 0xB1, 0x03)
    board.WriteI2C(Alias953, 0xB2, 0x1E) #CSI Data Identifier (0x24 = RGB888, 0x2C = RAW12, 0x2B = RAW10)
    
    # 0xA00 = 2560 bytes (= 1280 pixels x2)
    board.WriteI2C(Alias953, 0xB1, 0x04)
    board.WriteI2C(Alias953, 0xB2, 0x0A) #line size (15:8)
    board.WriteI2C(Alias953, 0xB1, 0x05)
    board.WriteI2C(Alias953, 0xB2, 0x00) #line size (7:0)
    
    # 0x140 = 320 bytes (= 2560/8)
    board.WriteI2C(Alias953, 0xB1, 0x06)
    board.WriteI2C(Alias953, 0xB2, 0x01) #bar size (15:8)
    board.WriteI2C(Alias953, 0xB1, 0x07)
    board.WriteI2C(Alias953, 0xB2, 0x40) #bar size (7:0)
    
    # 0x320 = 800 lines
    board.WriteI2C(Alias953, 0xB1, 0x08)
    board.WriteI2C(Alias953, 0xB2, 0x03) #active lines per frame (15:8)
    board.WriteI2C(Alias953, 0xB1, 0x09)
    board.WriteI2C(Alias953, 0xB2, 0x20) #active lines per frame (7:0)
    
    # 0x33F = 831 (VESA Standard)
    board.WriteI2C(Alias953, 0xB1, 0x0a)
    board.WriteI2C(Alias953, 0xB2, 0x03) #total lines per frame (15:8)
    board.WriteI2C(Alias953, 0xB1, 0x0b)
    board.WriteI2C(Alias953, 0xB2, 0x3F) #total lines per frame (7:0)
    
    # 10^9/(60x831x10) = 2006 = 0x7D6
    board.WriteI2C(Alias953, 0xB1, 0x0c)
    board.WriteI2C(Alias953, 0xB2, 0x07) #line period (15:8)
    board.WriteI2C(Alias953, 0xB1, 0x0d)
    board.WriteI2C(Alias953, 0xB2, 0xD6) #line period (7:0)
    
    # 0x21 = 33 (VESA Standard)
    board.WriteI2C(Alias953, 0xB1, 0x0e)
    board.WriteI2C(Alias953, 0xB2, 0x21) #vertical back porch
    
    # 0x0A = 10 (VESA Standard)
    board.WriteI2C(Alias953, 0xB1, 0x0f)
    board.WriteI2C(Alias953, 0xB2, 0x0A) #vertical front porch
    
    board.WriteI2C(Alias953, 0xB1, 0x10) 
    board.WriteI2C(Alias953, 0xB2, 0x00) #1st byte of fixed color
    
    board.WriteI2C(Alias953, 0xB1, 0x11)
    board.WriteI2C(Alias953, 0xB2, 0x00) #2nd byte of fixed color
    
    board.WriteI2C(Alias953, 0xB1, 0x12)
    board.WriteI2C(Alias953, 0xB2, 0xFF) #3rd byte of fixed color
    
    # board.WriteI2C(0xB1, 0x13)
    # board.WriteI2C(0xB2, 0xff) #4th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x14)
    # board.WriteI2C(0xB2, 0xff) #5th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x15)
    # board.WriteI2C(0xB2, 0x00) #6th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x16)
    # board.WriteI2C(0xB2, 0x00) #7th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x17)
    # board.WriteI2C(0xB2, 0x0f) #8th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x18)
    # board.WriteI2C(0xB2, 0xf0) #9th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x19)
    # board.WriteI2C(0xB2, 0x00) #10th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1A)
    # board.WriteI2C(0xB2, 0x00) #11th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1B)
    # board.WriteI2C(0xB1, 0x3f) #12th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1C)
    # board.WriteI2C(0xB2, 0xc0) #13th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1D)
    # board.WriteI2C(0xB2, 0x00) #14th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1E)
    # board.WriteI2C(0xB2, 0x00) #15th byte of fixed color
    
    # board.WriteI2C(0xB1, 0x1F)
    # board.WriteI2C(0xB2, 0x00) #16th byte of fixed color
    
    
    
    
    
    

    Best Regards,

    Casey