2017-09-15 01:26 AM
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 #i2cSolved! Go to Solution.
2017-09-22 08:47 PM
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.
2017-09-15 02:47 AM
Pull-up resistors are needed for the I2C bus (SDA, SCL signals).
2017-09-15 05:21 PM
Could it be the problem?
Also, what is the value of the external resistors?
Best regards.
2017-09-16 09:23 AM
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.1David
2017-09-16 12:07 PM
I will review the document. Thanks for it.
I am not sure yet that the problem is because the pull-up resistor. The code works sometimes while gives me different errors on most of the times.
Again, I appreciate your help.
2017-09-22 08:47 PM
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.