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.

TDA4VM: Deserializer and Serializer Register configuration from DataSheet

Part Number: TDA4VM


Dear Team,

I have gone through the example of the IMX390 sensor_drv source folder.

I found in the des_ser_configuration file that a few register addresses(apart from Reserved) are not configured and skipped in the register configuration parameter list.

Please let me know, on what basis we ignore the register addresses. Is there any specific guidelines or rule for this?

Thanks and Regards,

Vyom Mishra

  • Hello Vyom,

    can you point out these specific registers?

  • Dear Hamzeh,

    If you refer to the below Deserialzer configuration

    #define IMX390_D3_DES_CFG_SIZE    (59U)
    I2cParams ub960DesCfg_D3IMX390_0[IMX390_D3_DES_CFG_SIZE] = {
        {0x01, 0x02, 0x20},
        {0x1f, 0x00, 0x00},
    
        {0x0D, 0x90, 0x1}, /*I/O to 3V3 - Options not valid with datashee*/
        {0x0C, 0x0F, 0x1}, /*Enable All ports*/
    
        /*Select Channel 0*/                                               
        {0x4C, 0x01, 0x10},
        {0x58, 0x5E, 0x1}, /*Enable Back channel, set to 50Mbs*/
        {0x72, 0x00, 0x1}, /*VC map*/
    
        /*Select Channel 1*/
        {0x4C, 0x12, 0x10},
        {0x58, 0x5E, 0x1},/*Enable Back channel, set to 50Mbs*/
    
        /*Select Channel 2*/
        {0x4C, 0x24, 0x10},
        {0x58, 0x5E, 0x1},/*Enable Back channel, set to 50Mbs*/
       
        /*Select Channel 3*/
        {0x4C, 0x38, 0x10},
        {0x58, 0x5E, 0x1},/*Enable Back channel, set to 50Mbs*/
      
        {0x20, 0x00, 0x1}, /*Forwarding and using CSIport 0 */
    
        /*Sets GPIOS*/     
        {0x10, 0x83, 0x1},
        {0x11, 0xA3, 0x1},
        {0x12, 0xC3, 0x1},
        {0x13, 0xE3, 0x1},
    
        {0x4C, 0x01, 0x10}, /* 0x01 */
        {0x32, 0x01, 0x1}, /*Enable TX port 0*/
        {0x33, 0x02, 0x1}, /*Enable Continuous clock mode and CSI output*/
        {0xBC, 0x00, 0x1}, /*Unknown*/
        {0x5D, 0x30, 0x1}, /*Serializer I2C Address*/
        {0x65, (SER_0_I2C_ALIAS << 1U), 0x1},
        {0x5E, IMX390_I2C_ADDR, 0x1}, /*Sensor I2C Address*/
        {0x66, (SENSOR_0_I2C_ALIAS << 1U), 0x1},
        {0x6D, 0x6C,0x0}, /*CSI Mode*/
        {0x72, 0x00,0x0}, /*VC Map - All to 0 */
    
        {0x4C, 0x12, 0x10}, /* 0x12 */
        {0x32, 0x01, 0x1}, /*Enable TX port 0*/
        {0x33, 0x02, 0x1}, /*Enable Continuous clock mode and CSI output*/
        {0xBC, 0x00, 0x1}, /*Unknown*/
        {0x5D, 0x30, 0x1}, /*Serializer I2C Address*/
        {0x65, (SER_1_I2C_ALIAS << 1U), 0x1},
        {0x5E, IMX390_I2C_ADDR, 0x1}, /*Sensor I2C Address*/
        {0x66, (SENSOR_1_I2C_ALIAS << 1U), 0x1},
        {0x6D, 0x6C,0x0}, /*CSI Mode*/
        {0x72, 0x55,0x0}, /*VC Map - All to 1 */
    
        {0x4C, 0x24, 0x10}, /* 0x24 */
        {0x32, 0x01, 0x1}, /*Enable TX port 0*/
        {0x33, 0x02, 0x1}, /*Enable Continuous clock mode and CSI output*/
        {0xBC, 0x00, 0x1}, /*Unknown*/
        {0x5D, 0x30, 0x1}, /*Serializer I2C Address*/
        {0x65, (SER_2_I2C_ALIAS<< 1U), 0x1},
        {0x5E, IMX390_I2C_ADDR, 0x1}, /*Sensor I2C Address*/
        {0x66, (SENSOR_2_I2C_ALIAS << 1U), 0x1},
        {0x6D, 0x6C,0x0}, /*CSI Mode*/
        {0x72, 0xaa,0x0}, /*VC Map - All to 2 */
    
        {0x4C, 0x38, 0x10}, /* 0x38 */
        {0x32, 0x01, 0x1}, /*Enable TX port 0*/
        {0x33, 0x02, 0x1}, /*Enable Continuous clock mode and CSI output*/
        {0xBC, 0x00, 0x1}, /*Unknown*/
        {0x5D, 0x30, 0x1}, /*Serializer I2C Address*/
        {0x65, (SER_3_I2C_ALIAS << 1U), 0x1},
        {0x5E, IMX390_I2C_ADDR, 0x1}, /*Sensor I2C Address*/
        {0x66, (SENSOR_3_I2C_ALIAS<< 1U), 0x1},
        {0x6D, 0x6C,0x0}, /*CSI Mode*/
        {0x72, 0xFF,0x0}, /*VC Map - All to 3 */
        {0xFFFF, 0x00, 0x0} //End of script
    };
    

    After 0x01 directly we are filling 0x1f, Apart from the Reserved register addresses, On what basis we have not configured the other register in the list?

    If we have to configure a new SER/DES, how to proceed with the Register configuration, Which addresses are to be ignored which addresses should be configured?

    Is there any specific rule/ guidelines to configure the same?

    Please let me also know why below SER ALIAS and SENSOR ALIAS are left shifted by 1.

    {0x65, (SER_4_I2C_ALIAS << 1U), 0x1},

    {0x66, (SENSOR_4_I2C_ALIAS << 1U), 0x1},

    Thanks and Regards,

    Vyom Mishra

  • Hello,

    After 0x01 directly we are filling 0x1f, Apart from the Reserved register addresses, On what basis we have not configured the other register in the list?

    0x01 is digital resetting the device.

    0x1F is setting the CSI-lane speed to 1.6Gbps.

    Not all registers need to be configured. Only the ones needed for your application.

    If we have to configure a new SER/DES, how to proceed with the Register configuration, Which addresses are to be ignored which addresses should be configured?

    As said, this is based on your application. But there are some registers are required, for example enabling CSI output and CSI forwarding ... etc

    As an example, you can see this code for initializing 4 ports. But again, this is highly depending on your use case and functions you want to implement.

    dev_addr = 0x7A
    ser_alias = [0x18,0x1A,0x1C,0x1E]
    slave_addr = 0x60
    slave_alias = [0x22,0x22,0x32,0x32]
    fpd3_port_sel = [0x01,0x12,0x24,0x38]
    port_config = [0x7C,0x7C,0x7F,0x7F]
    bc_gpio_ctl0 = [0x88,0x88,0xAA,0xAA]
    
    # Configure CSI
    board.WriteI2C(dev_addr,0x32,0x03) # select CSI0 & CSI1 for write
    board.WriteI2C(dev_addr,0x33,0x03) # CSI_EN & cont clk
    board.WriteI2C(dev_addr,0x1F,0x00) # set CSI_TX_SPEED to 1.6Gbps
    board.WriteI2C(dev_addr,0x20,0x0C) # forward RX0 and RX1 to CSI0, forward RX1 and RX2 to CSI1
    
    # Configure framesync
    board.WriteI2C(dev_addr,0x18,0x01) # Enable FrameSync
    board.WriteI2C(dev_addr,0x10,0x91) # FrameSync signal; Device Status; Enabled
    board.WriteI2C(dev_addr,0x19,0x00) # FS_HIGH_TIME_1
    board.WriteI2C(dev_addr,0x1A,0x02) # FS_HIGH_TIME_0
    board.WriteI2C(dev_addr,0x1B,0x0A) # FS_LOW_TIME_1
    board.WriteI2C(dev_addr,0x1C,0xD6) # FS_LOW_TIME_0, Fred: Change 0xD6 to 0xD3
    
    # Configure GPIOs
    board.WriteI2C(dev_addr,0x10,0x81) # configure GPIO0 to bring out Lock for Port0
    board.WriteI2C(dev_addr,0x11,0x85) # configure GPIO1 to bring out Lock for Port1
    board.WriteI2C(dev_addr,0x12,0x89) # configure GPIO2 to bring out Lock for Port2
    board.WriteI2C(dev_addr,0x13,0x8D) # configure GPIO2 to bring out Lock for Port3
    
    # Configure RX
    board.WriteI2C(dev_addr,0x4C,0x0F) 	# fpd3 port select RX0, RX1, RX2 and RX3
    board.WriteI2C(dev_addr,0x58,0x5E) 	# Enable Pass Through and set the back channel to 50Mbps
    board.WriteI2C(dev_addr,0x72,0xE4) 	# assign unique VC0
    
    for i in range(4):
    	board.WriteI2C(dev_addr,0x4C,fpd3_port_sel[i])	# fpd3 port select
    	board.WriteI2C(dev_addr,0x5C,ser_alias[i]) 		# setup 953 (I2C Addr 0x30) alias address
    	board.WriteI2C(dev_addr,0x5D,slave_addr) 		# setup slave address (I2C Addr 0x60)
    	board.WriteI2C(dev_addr,0x65,slave_alias[i])	# setup slave alias address
    	board.WriteI2C(dev_addr,0x6D,port_config[i])	# setup FPD3_MODE
    	board.WriteI2C(dev_addr,0x6E,bc_gpio_ctl0)		# setup bc_gpio_ctl0
    	board.WriteI2C(dev_addr,0x7D,0x01)				# set PASS_THRESHOLD=1
    
    	print i
    	if (i==0 or i==1):
    		# Reset OVT10640 using BC GPIOs
    		board.WriteI2C(ser_alias[i],0x0E,0xC0) # Set GPIO2 and GPIO3 to outputs, where GPIO2 = RESET and GPIO3 = PWDN
    		board.WriteI2C(ser_alias[i],0x0D,0x0C) # Set GPIO2 and GPIO3 to High - bring OVT10640 out of power down mode
    		board.WriteI2C(ser_alias[i],0x0D,0x08) # Bring GPIO3 low to place 10640 in reset
    		board.WriteI2C(ser_alias[i],0x0D,0x0C) # Bring GPIO3 high again to prepare 10640 for initialization
    		time.sleep(0.5)
    		print "OVT10640 Reset"	
    	if (i==2 or i==3):
    		print  "FV_POLARITY"
    		board.WriteI2C(dev_addr,0x7C,0x01) # FV_POLARITY
    		print  "YUV422 DT"
    		board.WriteI2C(dev_addr,0x70,0x1f) # YUV422 DT
    	
    	print "init done"
    	# print "0x65 SlaveAlias[0] :", hex(board.ReadI2C(dev_addr, 0x65))
    
    # Configure VC IDs	
    board.WriteI2C(dev_addr,0x4C,0x01) # RX0
    board.WriteI2C(dev_addr,0x72,0x00) # VC0
    board.WriteI2C(dev_addr,0x4C,0x12) # RX1
    board.WriteI2C(dev_addr,0x72,0x01) # VC1
    board.WriteI2C(dev_addr,0x4C,0x24) # RX2
    board.WriteI2C(dev_addr,0x70,0x9F) # VC2
    board.WriteI2C(dev_addr,0x4C,0x38) # RX3
    board.WriteI2C(dev_addr,0x70,0xDF) # VC3
    
    board.WriteI2C(dev_addr,0x4C,0x00) # select port0 for read, no ports for write
    
    # comment this out when using ALP
    # board.close_i2c()

    Please let me also know why below SER ALIAS and SENSOR ALIAS are left shifted by 1.

    {0x65, (SER_4_I2C_ALIAS << 1U), 0x1},

    {0x66, (SENSOR_4_I2C_ALIAS << 1U), 0x1},

    The address is 7-bit but the register is 8-bit hence shifted by 1.