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: I2C Target Alias on 935/954 pair fails to take set value

Part Number: DS90UB954-Q1

Hi,

I am trying to enable the following I2C topology with a 935/954 SERDES pair:

I am able to communicate successfully with the remote serializer, and have written the following value to configure the address of the remote target device:

WriteRegister(GENERAL_CFG, b'\x1e')
WriteRegister(BCC_WATCHDOG, b'\xff')
WriteRegister(BCC_CONFIG, b'\xfe')
WriteRegister(RX_PORT_CTL, b'\x01')
WriteRegister(SER_ALIAS_ID, b'\x18')
Here is a log of all my reads from the DESER side:
MPY: soft reboot
Device found at address 0x30
Device Address 60
Mask ID 20
Camera LOCKED
SER_ID 30
GENERAL_CFG 1e
BCC_WATCHDOG fe
>>BCC_WATCHDOG ff
RX_PORT_CTL 83
GPIO_PIN_STS 10
GPIO_INPUT_CTL 7f
FPD3_PORT_SEL 11
RX_PORT_STS1 40
SENSOR_STS_0 0
SENSOR_STS_1 0
SENSOR_STS_2 0
BCC_CONFIG 1e
However, when I try to read something back from the serializer (7b addr 0x18) I cannot read. 
Could you please help me set this up so I can access remote target device with addr of 0xBA? 
Thanks,
Dhruv
  • Hi Dhruv,

    A few clarifying questions:

    • I noticed from the RX_PORT_STS1 register that the receiver is not locked. Could you clarify what you mean by you're able to communicate with your remote serializer?
    • For your remote sensor are you setting the TargetID and TargetAlias registers on the deserializer?
    • For your application are you using both port 0 and port 1 on the deserializer or just one of them? If one port is being used which one?
    • Lastly, is it possible for you to provide me your script?

    Looking forward to your response,

    Anthony

  • Hi Anthony,

    Thanks so much for your feedback. Please find my responses inline:

    • I noticed from the RX_PORT_STS1 register that the receiver is not locked. Could you clarify what you mean by you're able to communicate with your remote serializer?

    IIUC,  RX_PORT_STS1 is the status of the receiver being locked to incoming video data. Is this not the case? My DEVICE_STATUS register shows 0xDF. Also, when I read the SER_ID I read back 0x30.

    • For your remote sensor are you setting the TargetID and TargetAlias registers on the deserializer?

    I was trying to, but when I try to do a read back from said TargetAlias, I cannot.

    • For your application are you using both port 0 and port 1 on the deserializer or just one of them? If one port is being used which one?

    Just port 0.

    • Lastly, is it possible for you to provide me your script?

    Absolutely, please find below:

    from machine import Pin, I2C

    i2c = I2C(0, scl=Pin(5), sda=Pin(4), freq=100000)

    i2c.scan()


    DEV_ADDR = 0x30

    # Register Map
    DEVICE_ID = 0x00
    RESET = 0x01
    GENERAL_CFG = 0x02
    MASK_ID = 0x03
    DEVICE_STS = 0x04

    BCC_WATCHDOG = 0x07
    I2C_CTRL1 = 0x08

    RX_PORT_CTL = 0x0C
    IO_CTL = 0x0D
    GPIO_PIN_STS = 0x0E
    GPIO_INPUT_CTL = 0x0F

    FPD3_PORT_SEL = 0x4C
    RX_PORT_STS1 = 0x4D

    # Sensor status registers

    SENSOR_STS_0 = 0x51
    SENSOR_STS_1 = 0x52
    SENSOR_STS_2 = 0x53

    BCC_CONFIG = 0x58
    SER_ID = 0x5B
    SER_ALIAS_ID = 0x5C

    AEQ_CTL2 = 0xD2


    def ReadI2C(dev_addr, reg_addr):
      byte = i2c.readfrom_mem(dev_addr, reg_addr, 1)
      print(byte)
      return int.from_bytes(byte, "big")

    def ReadRegister(reg_addr):
      byte = i2c.readfrom_mem(DEV_ADDR, reg_addr, 1)
      return int.from_bytes(byte, "big")


    def WriteRegister(reg_addr, value):
      i2c.writeto_mem(DEV_ADDR, reg_addr, value)

    def CheckLock():
    dev_sts = ReadRegister(DEVICE_STS)
    #print('Device Status %x' % dev_sts )
      if(dev_sts == 0xdf):
      print('Camera LOCKED')


    # Reset
    WriteRegister(RESET, b'x\01')

    # General connection checks
    print('Device Address %x' % ReadRegister(DEVICE_ID))
    print('Mask ID %x' % ReadRegister(MASK_ID))

    CheckLock()


    # Read address of remote serializer
    print('SER_ID %x' % ReadRegister(SER_ID))

    WriteRegister(GENERAL_CFG, b'\x1e')
    print('GENERAL_CFG %x' % ReadRegister(GENERAL_CFG))


    print('BCC_WATCHDOG %x' % ReadRegister(BCC_WATCHDOG))
    WriteRegister(BCC_WATCHDOG, b'\xff')
    print('BCC_WATCHDOG %x' % ReadRegister(BCC_WATCHDOG))

    print('RX_PORT_CTL %x' % ReadRegister(RX_PORT_CTL))
    WriteRegister(RX_PORT_CTL, b'\x01')

    print('GPIO_PIN_STS %x' % ReadRegister(GPIO_PIN_STS))
    print('GPIO_INPUT_CTL %x' % ReadRegister(GPIO_INPUT_CTL))

    # Enable RX/TX on port 0
    WriteRegister(FPD3_PORT_SEL, b'\x11')
    print('FPD3_PORT_SEL %x' % ReadRegister(FPD3_PORT_SEL))


    print('RX_PORT_STS1 %x' % ReadRegister(RX_PORT_STS1))

    print('SENSOR_STS_0 %x' % ReadRegister(SENSOR_STS_0))
    print('SENSOR_STS_1 %x' % ReadRegister(SENSOR_STS_1))
    print('SENSOR_STS_2 %x' % ReadRegister(SENSOR_STS_2))

    WriteRegister(BCC_CONFIG, b'\xfe')
    print('BCC_CONFIG %x' % ReadRegister(BCC_CONFIG))

    ReadI2C(0x18, 0x00)

    CheckLock()

    Output Log

    Device Address 60
    Mask ID 20
    Camera LOCKED
    SER_ID 30
    GENERAL_CFG 1e
    BCC_WATCHDOG fe
    BCC_WATCHDOG ff
    RX_PORT_CTL 83
    GPIO_PIN_STS 10
    GPIO_INPUT_CTL 7f
    FPD3_PORT_SEL 11
    RX_PORT_STS1 40
    SENSOR_STS_0 0
    SENSOR_STS_1 0
    SENSOR_STS_2 0
    BCC_CONFIG 1e

  • FWIW, I have also tried the script here: https://e2e.ti.com/support/interface-group/interface/f/interface-forum/737135/ds90ub954-q1-how-to-set-i2c-alias-value (with my sensor addresses)

    But the moment I write anything to FPD3_PORT_SEL, my I2C bus seems to get poisoned. That being said, SER_ALIAS_ID takes the value set when I write 0x01 to FPD3_PORT_SEL:

    [48]
    Device Address 60
    Mask ID 20
    Camera LOCKED
    SER_ID 30
    GENERAL_CFG 1e
    BCC_WATCHDOG fe
    BCC_WATCHDOG ff
    RX_PORT_CTL 83
    GPIO_PIN_STS 10
    GPIO_INPUT_CTL 7f
    FPD3_PORT_SEL 1
    BCC_CONFIG 5e
    RX_PORT_STS1 13
    SENSOR_STS_0 0
    SENSOR_STS_1 0
    SENSOR_STS_2 3
    BCC_CONFIG 5e
    SER_ALIAS_ID 18
    Camera LOCKED

  • Hi Dhruv,

    Let's try making these changes to the script and see if we get desirable results.

    • If only port 0 is being used for your application let's set FPD3_PORT_SEL to 0x01. By setting FPD3_PORT_SEL to 0x01 you are enabling writes to port 0 registers and performing reads from port 0 registers. Originally, you had FPD3_PORT_SEL set to 0x11 which would be enabling writes to port 0 registers but performing reads from port 1 registers. On the 954 certain registers are port specific. For example, when you had FPD3_PORT_SEL set to 0x11 the RX_PORT_STS1 register was reading 0x40 indicating the receiver for port 1 is not locked. However, when you had FPD3_PORT_SEL set to 0x01 the RX_PORT_STS1 register was reading 0x13 indicating the receiver for port 0 is locked. The figure below shows registers 0x4C-0x7F and registers 0xD0-0xDF are port specific.

    • Try reconfiguring your TargetID register and TargetAlias register. These registers are necessary in order to be able to communicate with a remote sensor. For example, you set your SER_ID and SER_ALIAS in order to be able to communicate with your remote serializer.
    • Confirm your BCC_CONFIG bits [2:0] match your strap settings.
    • Lastly, I would keep the BCC_WATCHDOG enabled as this helps to prevent a lock-up condition on the control channel when no response is available from the remote/remote-slave device.

    Please let me know if these changes allow you to communicate with your sensor.

    Best regards,

    Anthony

  • Hi Anthony,

    Thanks again for the suggested steps! So, I am now only doing two writes after startup, and have confirmed the BCC_CONFIG and BCC_WATCHDOG settings:

    Device Address 60
    Mask ID 20
    Camera LOCKED
    SER_ID 30
    GENERAL_CFG 1e
    BCC_WATCHDOG fe
    GPIO_PIN_STS 10
    GPIO_INPUT_CTL 7f
    >>>Wrote 1 to 4c
    FPD3_PORT_SEL 1
    BCC_CONFIG 1e
    RX_PORT_STS1 3
    SENSOR_STS_0 0
    SENSOR_STS_1 0
    SENSOR_STS_2 3
    >>>Wrote 50 to 5c
    SER_ALIAS_ID 50
    Camera LOCKED

    However, when I try to do a read from the SER_ALIAS_ID I set in the end (I tried both 7b and 8b flavors of the address) I cannot seem to read. 

    ReadI2C(0x50, 0x00)

    Traceback (most recent call last):
    File "<stdin>", line 118, in <module>
    File "<stdin>", line 44, in ReadI2C
    OSError: [Errno 5] EIO

    I feel like I am missing something very basic. Could this be related to clock stretching?

    Dhruv

  • Hi Dhruv,

    I see that you changed your BCC_CONFIG from 0x5E to 0x1E. Please leave BCC_CONFIG as 0x5E so that I2C Pass-Through is enabled. If I2C Pass-Through is disabled then you will not be able to communicate with your remote serializer and sensor.

    Let me know the results.

    Best regards,

    Anthony

  • Hi Anthony,

    I tried that too, but no joy unfortunately. I am still unable to do remote peek/poke from the serializer.

    Device Address 60
    Mask ID 20
    Camera LOCKED
    SER_ID 30

    >>>Wrote 1E to 2
    GENERAL_CFG 1e
    RX_PORT_CTL 83
    GPIO_PIN_STS 10
    GPIO_INPUT_CTL 7f

    >>>Wrote 1 to 4C
    FPD3_PORT_SEL 1
    RX_PORT_STS1 13
    SENSOR_STS_0 0
    SENSOR_STS_1 0
    SENSOR_STS_2 3

    >>>Wrote 5E to 58
    BCC_CONFIG 5e

    >>>Wrote 18 to 5C
    SER_ALIAS_ID 18
    Camera LOCKED

    Thanks,

    Dhruv

  • By the way, I also have local access to the serializer over a debug cable, and can confirm that the DESER_ID register (0x37) and the GENERAL_STATUS looks healthy too.

    is DESER_ID 0x60
    GENERAL_STATUS 0x45

  • OK! I think I found the solution. Even though the SER_ID is auto-loaded from the remote link, we need to write it explicitly to be able to do accesses to the remote slave. I am happy to report I now have an end to end link on the above topology! Smiley

    >>>Wrote 30 to 5B

    >>>Wrote 18 to 5C
    SER_ALIAS_ID 18
    Camera LOCKED
    I2C devices found: [24, 48]

    Works now!

  • Hi Dhruv,

    Awesome to hear! I will close this thread. Feel free to reopen this thread if similar problems as above arise.

    Best regards,

    Anthony