AnsweredAssumed Answered

Please fix LIS3DSH datasheet.

Question asked by noble.nicolas on Mar 10, 2015
It took me a while to understand it, but the datasheet for the LIS3DSH chip is dead wrong. It's a pretty obvious copy/paste mistake while creating that datasheet from another chip, but there is no such thing on that chip as a multibyte flag on the SPI protocol.

Let me say that again: the pages 25 to 28 of document describe the bit "MS", which, in fact, doesn't exist. Also note that every piece of code that is provided within STMCube or SPL is wrong when dealing with that chip.

On page 35, table 29, there is a description of the bit ADD_INC from Control Register 6, which does just that: automatically increments the address value when reading sequentially. So it'd be redundant and contradictory with any bit from the SPI protocol itself.

It took me a while to figure that one out because I was stubborn enough to try reading all 6 registers for the X/Y/Z axis in one multibyte read. But I was getting wrong and different data than what I'd get if I was reading byte per byte. I was trying to wonder why the STMCube code was reading one register at a time, until it hit me: the SPI hardware abstraction layer doesn't correspond to that chip. And after a few tries, I realized that instead of reading registers 0x28 to 0x2d, I was in fact reading registers 0x68 to 0x6d.

Anyway, long story short, please fix your code, and more importantly, your datasheet. This is beyond sloppy.