I am facing a strange issue reading acceleration values from an ADXL375 part using the SPI interface.
When I read just a single acceleration value (eg: DATAX1) the value is reported fine.
When I modify my code to read two registers (eg: DATAX0 and DATAX1) as part of separate SPI read operations then the register value of X1 is clearly wrong.
In my case the board is at rest when the experiment is performed and so I would expect the DATAX1 register value to return a 0. This is indeed the case when that is the only register I read (albeit in a loop over and over again).
When I read both DATAX0 and DATAX1 as part of the loop, the value read from DATAX1 quite often becomes '1'. This indicates as acceleration of over 20g which is clearly wrong.
Like I mentioned, these are separate read operations - as in CS is asserted, the first read performed, CS is deasserted. Then the process is repeated for the second register.
I see similarly wrong results when I perform the multi byte read rather than doing two reads back to back.
I also see similar behavior when I read other axes, where Y1 and Z1 are zero if read by themselves but get distorted when other registers are read as well.
I am able to read devid and am in general confident of my setup.
If this is relevant, my setup uses an STM32l1 microcontroller as my host processor.
Any inputs are appreciated.