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.

DS90UB949A-Q1EVM: How to expand receive/read buffer size to a length of >32 bytes using board.ReadI2C(0x00,0x00,>31) in Analog Launchpad ALP?

Part Number: DS90UB949A-Q1EVM
Other Parts Discussed in Thread: ALP, USB2ANY

I have made with the TI Board and Application Layer Protocol (ALP) in relation to read/write I2C transactions.

 

At this juncture, I have encountered a query regarding the buffer limitation of the TI ALP (Python) and the Serializer board. My current endeavor involves reading I2C messages that exceed 32 bytes in length.

for example, if I execute -> board.ReadI2C(0x15, 0x45, 31)

Output->[1,0,0,0,13,0,0,0,0,0,0,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81] //31 example output with data

However, If I execute board.ReadI2C(0x15, 0x45, 32)

Output->[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] //example 32 length output with No data 

The problem was that the third parameter of board.ReadI2C could only read up to 31 bytes.

I think this is probably because the receive buffer is only available up to 32 bytes.

Is it is possible to expand the receive buffer to a value >31 (32 bytes of data)?

I would greatly appreciate your guidance on how to augment the buffer size to facilitate the reading of data exceeding 32 bytes. Your expertise and assistance in this matter would be invaluable.

  • Hi Steven,

    Looking into this, the limitation of the >32-Byte read exists in the USB2ANY API 2.7.0.0 limitation, as the firmware is fixed for reading 32 Bytes or fewer.

    Since ALP uses this USB2ANY API for interfacing with the devices, it appears it cannot be altered from the ALP side of development, as we are not able to expand the buffer from the ALP libraries.

    Best,

    Miguel

  • Hi Miguel,

    Do you know of any other scripting that can access a register start or stop length? for example, if I wanted to read from register length index 32-64, is this possible to do in ALP?

    Thanks,

     - Steven

  • Hi Steven,

    May I ask the purpose of simultaneously reading > 32 Bytes of data over I2C?

    Also it appears that 0x45 is a reserved register in reference to the 949A device, is there a reason you are trying to read the > 32 Bytes from here as an example?

    Best,

    Miguel

  • Hi Miguel,

    The purpose of reading >32 bytes of data over I2C is to gather some internal diagnostic information related to a project I am working on. There are around 70 bytes of data which are contained in these diagnostics/data. 

    The example I was using above was not the actual reserved registers I was attempting to target. 

    Best,

    -Steven

  • Hi Steven,

    Thank you for clarifying! I think I understand better now, the 70 bytes is coming from an external source, not the SER-DES devices themselves.

    In this case, the most probable solution to the 32-Byte buffer limitation is to do multiple I2C reads, and access the separate indexes as you have mentioned above, and concatenate the results into a list. I believe we have an example on a smaller scale on how this is done. Please allow me some time to look into this. I will provide you with any updates I find.

    Best,

    Miguel

  • Much appreciated Miguel! I look forward to your reply.

    Best,

     - Steven

  • Hi Miguel,

    I was wondering if another work around for this issue would be to have the data print out as text instead of data bytes? Is this also limited by any library constraints?

  • Hi Steven,

    Thanks for your patience, E2E is experiencing issues with loading.

    Here is an example of a 16 Byte read that is used in our devices, but this assumes that there are separate locations where the byte information is stored (APB registers for 949):

    def apb_read_reg(addr16b, channel, Device_ID):
       APB_CTL = 0x48
       APB_ADR0 = 0x49
       APB_ADR1 = 0x4A
       APB_DATA0 = 0x4B
       APB_DATA1 = 0x4C
       APB_DATA2 = 0x4D
       APB_DATA 3 = 0x4E

    if channel == 0 :
       page = 0x03
    elif channel == 1 :
       page = 0x0B
    else :
       page = 0x03

    addr16b_lsb = addr16b &0xFF
    addr16b_msb = (addr16b & 0xFF00) >> 8
    board.WriteI2C(Device_ID, APB_ADR0, addr16b_lsb)
    board.WriteI2C(Device_ID, APB_ADR1, addr16b_msb)
    board.WriteI2C(Device_ID, APB_CTRL, page)

    apbData0 = board.ReadI2C(Device_ID, APB_DATA0)
    apbData1 = board.ReadI2C(Device_ID, APB_DATA1)
    apbData2 = board.ReadI2C(Device_ID, APB_DATA2)
    apbData3 = board.ReadI2C(Device_ID, APB_DATA3)

    apbData = (apbData3 << 24) + (apbData2 << 16) + (apbData1 << 8) + (apbData0 <<0)
    val32bit = apbData
    return val32bit

    RegVal = apb_read_reg(0x004, int(Port), Device_RX)
    print "Result = ," (RegVal)

    As I am aware, I do not know of limitations within the library to have the data print as text instead of bytes, but I can check with the team on whether there exists any constraints for this.

    Best,

    Miguel

  • Thank you very much for your support here. I am going to look over your reply/code and discuss this with my team. Do you have any additional documentation or information about your previous reply? I am trying to figure out how to use it in order to break up the data bytes? 

     - Steven

  • Hi Steven,

    The additional documentation I can provide is that the USB2ANY forums may be able to provide more detail on the API that ALP implements to run the I2C functions, also the Library for the board I2C write and read commands exists under [Directory]\Analog LaunchPAD v1.57.0010\Profiles\FPDL3Base, as FPDLink3_Lib.py. 

    Best,

    Miguel