2021-08-08 09:00 PM
we are trying to configure LSM6DSOX in high-performance mode. Following configurations are done on the sensor
ODR --> 6.66khz(high performance mode) and G-Range --> 16g
Register addr(CTRL6_C) --> XL_HM_MODE --> value(0x00)
Register addr(CTRL6_XL) --> XL_FS_MODE --> value(0x00)
Register addr(CTRL1_C) --> ODR(6.66khz) and G range(16g) -->value(0xA4)
observed output values around 62242 range for x-y-z-axis
can you please confirm whether our configurations are correct and the observed value is the expected value?
Solved! Go to Solution.
2021-08-26 06:47 AM
Hi TBomb,
finally, we found the solution for this thank you so much for your support
2021-08-11 12:22 AM
please can anyone reply for this
2021-08-11 03:01 AM
Hi, the value looks too high, the conversion formula to milli-g is the one here below, from Github drivers:
float_t lsm6dsox_from_fs16_to_mg(int16_t lsb)
{
return ((float_t)lsb) * 0.488f;
}
Did you concatenate correctly the 3x2 output registers?
You should at least see some differences between x and z axis when the device is flat on a surface (x almost close to 0, y almost close to 1g).
Tom
2021-08-11 03:20 AM
Hi TBomb,
Thank you so much for the reply,
whether this concatenation correct for the output register?
for (i=0 ; i<6 ; i++)
{
txBuf_1[0] = 0x28 + i | 0x80 ;// OUTX_L_A and OUTX_H_A(Reg Addr(xData,yData,zData)) + Read Commend
txBuf_1[1] = 0x00;
Start_SPI_Transaction_1(txBuf_1,2,rxBuf_1,2);
xyzData_1[i]= rxBuf_1[1];
}
xData_1= ((xyzData_1[1] & 0xFF) <<8) | xyzData_1[0];
yData_1= ((xyzData_1[3] & 0xFF) <<8) | xyzData_1[2];
zData_1= ((xyzData_1[5] & 0xFF) <<8) | xyzData_1[4];
2021-08-11 05:24 AM
The code looks ok. Does the device returns the correct WHO_AM_I value when you read the 0Fh register?
And do you have the possibility to check another sample?
Tom
2021-08-11 05:39 AM
Hi TBomb,
Yes WHO_AM_I register is working fine
we are using a while loop to get the sample in all the samples we are getting the same value
we are worried about not getting the excepted sample can you please help regarding this
2021-08-12 07:05 AM
Hi, so it might be an issue related to the initialization of the device. Did you correctly configured the LSM6DSOX to get the data output?
There are examples on the application note and on Github, you can try for example these configurations and check:
1. Write 50h to CTRL1_XL // Turn on the accelerometer // ODR_XL = 208 Hz, FS_XL = ±2 g
2. Write 40h to CTRL2_G // Turn on the gyroscope // ODR_G = 104 Hz, FS_G = ±250 dps
Tom
2021-08-12 07:56 AM
Hi TBomb,
Thank you so much for your reply,
we are doing CTRL1_XL --> 0xA4 //Turn on the accelerometer ODR_XL - 6.66khz and FS_XL=+-16g
is correct?
I also have another doubt to get the raw data output what are the register to be initialized?
we have initialized only these register
1) Software reset
txBuf_1[0] = 0x12 | 0x00; //Register Addr(CTRL3_C) + write command
txBuf_1[1] = 0x01; //Register Addr(CTRL3_C) -> SW_RESET
Start_SPI_Transaction_1(txBuf_1, 2, rxBuf_1, 0);
2) ODR --> 6.66Khz(High performance mode) and G-Range --> 16g
txBuf_1[0] = 0x15 | 0x00; //Register Addr(CTRL6_C) + write command
txBuf_1[1] = 0x00 ; //Register Addr(CTRL6_C) -> XL_HM_MODE
Start_SPI_Transaction_1(txBuf_1,2,rxBuf_1,0);
txBuf_1[0] = 0x17 | 0x00; //Register Addr(CTRL8_XL) + write command
txBuf_1[1] = 0x00; //Register Addr(CTRL8_XL) -> XL_FS_MODE
Start_SPI_Transaction_1(txBuf_1,2,rxBuf_1,0);
txBuf_1[0] = 0x10 | 0x00 ; //Register Addr(CTRL1_C) + write command
txBuf_1[1]= 0xA4 ; //Register Addr(CTRL1_XL) -> ODR(6.66Khz ) and G range(16 g)
Start_SPI_Transaction_1(txBuf_1,2,rxBuf_1,0);
3) Raw data collection
for (i=0 ; i<6 ; i++)
{
txBuf_1[0] = 0x28 + i | 0x80 ;// OUTX_L_A and OUTX_H_A(Reg Addr(xData,yData,zData)) + Read Commend
txBuf_1[1] = 0x00;
Start_SPI_Transaction_1(txBuf_1,2,rxBuf_1,2);
xyzData_1[i]= rxBuf_1[1];
}
xData_1= ((xyzData_1[1] & resolutionScreening) <<8) | xyzData_1[0];
yData_1= ((xyzData_1[3] & resolutionScreening) <<8) | xyzData_1[2];
zData_1= ((xyzData_1[5] & resolutionScreening) <<8) | xyzData_1[4];
can you please support us regarding this
2021-08-18 01:56 AM
Hi @Sprem.1 , configuration should be correct. Are you facing further issues?
Tom
2021-08-26 06:47 AM
Hi TBomb,
finally, we found the solution for this thank you so much for your support