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.

LAUNCHXL2-RM57L: I2C Connection RM57L Launchpad

Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: HALCOGEN

Hi Team,

Good day. Could you help us check our customer concern's as shown below. Referring to the TRM does not solve the issue. 

I have the following problem with the RM57L Launchpad. I am trying to establish a working I2C connection.

However, when I want to send data my code always stops in the SendByte method.

The byte to send is written correctly into the I2CDXR register. However, it is not sent from there to the bus.

Can you help me further what the problem could be? Shouldn't it be that once the data is written to the DXR register it is automatically sent to the bus?

I have attached the code and a screenshot of the DXR register showing that the correct value was written to this register.

I2C-Code.txt

Thank you in advance for the support. 

Best regards,

Jonathan

  • Hi Jonathan,

    Both SCL and SDA lines are open-drain. I2C module can drive its output low, but it cannot drive it high. For the line to be able to go high, you must pull up SCL and SDA to VCCIO (3.3V) through a resistor. You only need one set of pull-up resistors for the whole I2C bus, not for each device.

    https://www.ti.com/lit/pdf/slva689

  • Thank you for the answer.

    The pull-ups were set via HALCoGen for the SDA and SCL line (see screenshot). Unfortunately the problem remains as described above. Would you have another suggestion?

  • Hi Thilo,

    The internal pullups are too weak to be used for I2C. They're just strong enough to keep the pins from floating.  You have to provide external pull-up to I2C signals.

  • Thank you for theclarification. Unfortunately, connecting an external pull-up resistor did not solve the problem either. We have now switched to another board and there, using the same code, the bytes are sent correctly. However, after sending the data and after the ACK of the slave, no stop condition is sent. We noticed that the I2CCNT register is not counting down after the bytes are sent. According to my understanding, this is the reason why no stop condition is sent. Can you tell me what could be the reason that the register is not counted down?

  • Hi Thilo,

    If STP is not set, the STOP condition is not generated. If the RM (repeat mode) is set, the I2CCNT is not used.

  • Unfortunately, connecting an external pull-up resistor did not solve the problem either.

    What are the value of the pull-up resistors on SDA and SCK lines?

    If the pullup resistor value is too small, the I2C line can not be driven to Low. If the pull-up resistor value is too high, the I2C line may not rise to a logical high before it is pulled low.

  • STP is set, the RM is not set. The mode register is 0x0E20, as a start condition has already been generated. The pull ups are 2.2k and the I2C signals on the bus look good when checked on the oscilloscope, data is sent and the slave acknowledges it. However the I2CCNT register always stays at the starting value and doesn't count down. Therefore at the end of the access no stop condition is generated. 

    Do you have any idea why the I2CCNT register isn't counting down?

    Thank you for your help

  • There is no problem with your code since it works on another HDK. It is board issue or device issue. I don't know why the I2CCNT doesn't count down.