AnsweredAssumed Answered

lsm6Dsl FIFO continuous mode interrupt problem.

Question asked by vladimir boretsky on May 10, 2018

Hello FRIENDS!

I have problem with chip LSM6DSL using.
My purpose is use this chip in the FIFO continues mode. I would like receive interrupt from INT1 pin when FIFO full and read info from FIFO. I am working from STM32L452 processor.
I tried some chips with my dev board and I have only one chip working properly. It's mean I received rizing front interrupt from INT1 pin and I can read dates from FIFO.
Another chips not provides INTERRUPT. The contacts from microcontroller to chip was checked.

My registers set up is:
data = 0x01;
data1 = ReadLsm6ds3Register(WHO_AM_I);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);
//Write to FIFO_CTRL3 register. GYRO not in FIFO, Gyro -- no decimation Register adress is 0x08
data = 0x01;
error_status = WriteLsm6ds3Register(data,FIFO_CTRL3);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

ReadRegister = ReadLsm6ds3Register(FIFO_CTRL3);

HAL_Delay(200);
//////////////////// FIFO CONFIGURATION //////////////////

/* Acc 104 hz */
data = 0x60; // 208Hz 0x 60 value is 416hz 0x50 208Hz 0x40 104Hz BW = 1.5KHz Register adress 0x10
error_status = WriteLsm6ds3Register(data,CTRL1_XL);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

ReadRegister = ReadLsm6ds3Register(CTRL1_XL);

HAL_Delay(200);

/* Set FIFO 3rd and 4th NOT in FIFO Register number 0x09 */
data = 0;//0x01;
error_status = WriteLsm6ds3Register(data,FIFO_CTRL4);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

/* Set Fifo ODR to 104Hz and Continuous mode . Register number 0x0A */

data =0x36; //FIFO continues mode

error_status = WriteLsm6ds3Register(data,FIFO_CTRL5);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

ReadRegister = ReadLsm6ds3Register(FIFO_CTRL5);

HAL_Delay(200);

/* Set FIFO ODR to highest value *
if (BSP_GYRO_FIFO_Set_ODR_Value_Ext(LSM6DSL_G_0_handle, LSM6DSL_FIFO_MAX_ODR) == COMPONENT_ERROR)
{
return COMPONENT_ERROR;
}
*/

/* Set FIFO_FULL on INT1 Register number 0x0D*/
data = 0x20; //FIFO full flag on INT1
error_status = WriteLsm6ds3Register(data,INT1_CTRL);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

ReadRegister = ReadLsm6ds3Register(INT1_CTRL);

HAL_Delay(200);

/* Set When the FIFO is used, the IF_INC and BDU bits of the CTRL3_C register must be equal to 1. Register number 0x12*/
data = 0x44;
error_status = WriteLsm6ds3Register(data,CTRL3_C);
if(error_status == 1)
{
acc_error_flag = 1;
return;
}

HAL_Delay(200);

ReadRegister = ReadLsm6ds3Register(CTRL3_C);

HAL_Delay(200);

What I do wrong?
Could send me proper registry init sequence and values?

Best regards.#

Outcomes