cancel
Showing results for 
Search instead for 
Did you mean: 

IIS3DWB Sensor Intermediate giving Zero or Negative data

SidramayyaSwami
Associate
1.Sensor variant: IIS3DWB
2.Communication Interface with ESP32 : SPI
3. Data Reading is based on the ISR. Maximum sampling rate we are reading up to 6.7khz
4.using the INT1_CTRL register for the Interrupt config
 
 
Issue Description : Based on the block size(Number of data samples read) we are reading the data from the sensor on SPI interface. For the one data acquisition cycle sometimes we are getting the intermediate Negative value and some times 0 as well.
The data we are reading from the data read registers ( Register Name and Address : OUTX_L_XL - 0x28 ,OUTX_H_XL - 0x29, OUTY_L_XL - 0x2A, OUTY_H_XL - 0x2B, OUTZ_L_XL - 0x2C, OUTZ_H_XL - 0x2D).
For the Axis the data should be either positive or negative. But sometimes we are getting both values from the above register. As per the logs we can see the Negative value is in the range of (-20000 to -32768). This is unexpected values we are getting from that data acquisition cycle.
The same is happening with the temperature data register also. When we are reading the temperature data register sometimes getting Negative/Zero values for few samples.
(Register Address: OUT_TEMP_L - 0x20, OUT_TEMP_H - 0x21)
So, Please let know If anything extra needs to be do in firmware with respect to register Initialization or any register setting for the data accuracy.
3 REPLIES 3
Federica Bossi
ST Employee

Hi @SidramayyaSwami ,

Welcome to ST Community!

Are you working in C?

I suggest you to take a look at our github examples, let me know if by using them you can solve the problem

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Federica Bossi ,

I am working on c++. I have created the one library In that I have added all the requried registers and address and also few functions to Initialize the registers and perform data read and write operation. And that API's I am using in my actual firmware. Where Based on the ISR I am doing the data acquisition.

OK, did you try to compare your writings with the library I sent you?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.