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.

LDC1314: Trouble Reading Registers using Matlab Embedded Coder

Part Number: LDC1314

Hello everyone,

I am trying to use an LDC1314 through my Launchpad F28379D using Matlab Embedded Coder.

I can succesfully send information to be written to the registers.

Nevertheless, whenever I try to read something (ie RCOUNT0 register, subsystem at the right), the program will keep sending the attached signal (which I obtained with the oscilloscope).

According to me, it is just trying to read, thus missing the FRAME 1 and FRAME 2 that correspond to what should have been transmitted before the reading sequence.

Any suggestions? Here you can see my simulink 'read' subsystem.

Thank you very much in advance,

Patricio

  • Hello Patricio,

    Can you share what your SCL/SDA lines look like during the write operations? 

    It looks like Frame 1 is there. The master starts the transaction and specifies a read operation at I2C bus address 0x2A, then the slave ACKs. This looks normal. However, the next frame looks wrong. After transmitting the register address, the master NACKs then STOPs. This is what prematurely ends the communication. Can you double-check what the program is telling the MSP430 to do during the read operation? The slave should ACK after the second frame, so the master should not affect the lines. 

    Best Regards,

  • Hello Patricio,

    I haven't heard from you in a while, so I'm assuming you were able to resolve your issue. If this is not the case please feel free to reply to this thread or post a new question.

    Best Regards,

  • Hello Kristin,

    Thanks for the help.

    The Matlab script had an inner (rather hidden) priority setting, in which the read operation was performed BEFORE the write operation, thus becoming stuck trying to read something from an unknown address.

    With the structure and configuration displayed in the attached image, I was able to set the write operation first, and then read without any problems.

    Thank you

    Patricio