cancel
Showing results for 
Search instead for 
Did you mean: 

LSM9DS1 SPI only write

Mich1
Associate III
Posted on March 24, 2017 at 11:48

What is the meaningful of 'SPI only write' SIM bit of CTRL_REG3_M (22h) register?

How magnetometer values can be read if SPI is in write only mode?

1 REPLY 1
Bill Burgess
Associate II
Posted on April 20, 2017 at 21:28

I think there's an egregious typo in the entry for CTRL_REG3_M.  What use is a write-only SPI device?  LOL!  Luckily, elsewhere in the manual it indicates that the SIM bit (why is it called SIM?) controls whether the magnetometer is in 4-wire mode (0) or 3-wire mode (1).

I suspect the author of the entry for CTRL_REG3_M was trying to say whether **SDI** (not SPI!) is usable for output as well as input (3-wire mode, set the bit to 1) or for input only (4-wire mode, set the bit to 0).

On this topic, I have just found that in my application, I need to write 0 to this bit before I can read from the device in 4-wire mode.  The data sheet says 0 is the default value for the SIM bit.  But if I try to read WHOAMI after power-up in a 4-wire SPI system, it won't work unless I first write the supposed 'default' value of

CTRL_REG3_M to that register.

So, I suspect that not only is there a knee-slapper of a typo in the entry for CTRL_REG3_M, there may also be an error in the default value for the SIM bit.