Skip to main content
Visitor II
September 15, 2017
Solved

Unstable I2C Connection to STEVAL-MKI137V1

  • September 15, 2017
  • 2 replies
  • 991 views
Posted on September 15, 2017 at 10:26

Hi all,

I connected STEVAL-MKI137V1 (Magnometer sensor) to STM32L152D-EVAL through I2C. The library I am using is from STM32CubeExpansion_MEMS1_V4.0.0.

I connected I2C pins to PB11 and PB10 without any external resistors on 

STEVAL-MKI137V1 side.

The problem is weird for me. Most of the times the code do not work, it give error like Acknowledge Failure, and sometimes the code works very well without any error!

What is the expected reason of this problem? How can I solve it?

Note: is the problem related to external pull-up resistors? Because I did not use them.

Thanks in advance.

#steval-mki137v1 #i2c
    This topic has been closed for replies.
    Best answer by Khaled Aljehani
    Posted on September 23, 2017 at 05:47

    The problem was solved. In the datasheet it is written that:

    'To select/exploit the I2C interface, the CS line must be tied high (i.e. connected to Vdd_IO).'

    So, I connected the pin.

    Best regards.

    2 replies

    ST Employee
    September 15, 2017
    Posted on September 15, 2017 at 11:47

    Pull-up resistors are needed for the I2C bus (SDA, SCL signals).

    Visitor II
    September 16, 2017
    Posted on September 16, 2017 at 00:21

    Could it be the problem?

    Also, what is the value of the external resistors?

    Best regards.

    September 16, 2017
    Posted on September 16, 2017 at 16:23

    Yes, it can.

    Try the usual 4k7 value.

    If you wanted a more scientific method to compute the resistor values, have a look at

    https://www.nxp.com/docs/en/user-guide/UM10204.pdf

    , section 7.1

    David

    Khaled AljehaniAuthorAnswer
    Visitor II
    September 23, 2017
    Posted on September 23, 2017 at 05:47

    The problem was solved. In the datasheet it is written that:

    'To select/exploit the I2C interface, the CS line must be tied high (i.e. connected to Vdd_IO).'

    So, I connected the pin.

    Best regards.