2019-06-04 06:04 AM
Hi,
I am trying to read data from the IIS2MDC placed on a STEVAL-MKI185V1 on a STM32F103C board programmed via Arduino IDE.
I tried following the steps mentioned in the document in the link:
However when I read the WHOIAM register it gave a value of 0 instead of 0x40. Subsequently I am unable to read the magnetometer register values.
PFA the code that I am working on.
Any help for this is much appreciated.
Thank You
2019-06-12 08:30 AM
Hi, the fact you are reading 00h on the WHO_AM_I make me suspect the issue is on the communication. Could you check the integrity of the I2C transmission and share the oscilloscope or pattern analyzer screen? Which frequency / Vdd or VddIO / pull-up value are you working at? To check the issue is related to the communication and not to the sensor, you could try interface to it to through the SPI. I think you already did it, but please note that the 8bit I2C slave address is 3D or 3C and not 1E.
Regards
2019-06-12 09:28 PM
Hi Eleon,
Thank you for your response. But I have got it working now. Turns out I had missed out on the pull up resistors. Once I added them it worked like a charm.
Thank You