cancel
Showing results for 
Search instead for 
Did you mean: 

ism330dlc data ready pin cluster issue

saad_128
Associate

Hello, 

I am using ISM330DLC sensor for my application on Esp32. Data ready pin from esp32 and sensor is being used to check if values are avalaible on the sensor or not. 

 

As per the Application note AN5125, Data ready pin should high for a while and then all data should be fetched properly. 

saad_128_0-1707305738017.png

 

But in my case when I set ODR to 6500 Hz for Accelerometer, data ready pin counting 6500 in a second, but accelerometer samples are only collected 900 in a second (which should be (6500*3) per second). 

I am using init function from ISM330dlc library: 

/**
 * @brief  Configure the sensor in order to be used
 * @retval 0 in case of success, an error code otherwise
 */
ISM330DLCStatusTypeDef ISM330DLCSensor::begin()
{
  if(dev_spi)
  {
    // Configure CS pin
    pinMode(cs_pin, OUTPUT);
    digitalWrite(cs_pin, HIGH);
  }

  /* Enable register address automatically incremented during a multiple byte
     access with a serial interface. */
  if ( ISM330DLC_ACC_GYRO_W_IF_Addr_Incr( (void *)this, ISM330DLC_ACC_GYRO_IF_INC_ENABLED ) == MEMS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* Enable BDU */
  if ( ISM330DLC_ACC_GYRO_W_BDU( (void *)this, ISM330DLC_ACC_GYRO_BDU_BLOCK_UPDATE ) == MEMS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* FIFO mode selection */
  if ( ISM330DLC_ACC_GYRO_W_FIFO_MODE( (void *)this, ISM330DLC_ACC_GYRO_FIFO_MODE_BYPASS ) == MEMS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* Output data rate selection - power down. */
  if ( ISM330DLC_ACC_GYRO_W_ODR_XL( (void *)this, ISM330DLC_ACC_GYRO_ODR_XL_POWER_DOWN ) == MEMS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* Full scale selection. */
  if ( Set_X_FS( 2.0f ) == ISM330DLC_STATUS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* Output data rate selection - power down */
  if ( ISM330DLC_ACC_GYRO_W_ODR_G( (void *)this, ISM330DLC_ACC_GYRO_ODR_G_POWER_DOWN ) == MEMS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  /* Full scale selection. */
  if ( Set_G_FS( 2000.0f ) == ISM330DLC_STATUS_ERROR )
  {
    return ISM330DLC_STATUS_ERROR;
  }

  X_Last_ODR = 104.0f;

  X_isEnabled = 0;

  G_Last_ODR = 104.0f;

  G_isEnabled = 0;

  return ISM330DLC_STATUS_OK;
}

Fro Data ready config I am using: 

// Set accelerometer data rate to 416 Hz in high-performance mode
// Enable accelerometer data-ready interrupt on INT1


if (ISM330DLC_ACC_GYRO_W_LowPower_XL((void *)this, ISM330DLC_ACC_GYRO_LP_XL_DISABLED) != MEMS_SUCCESS) {
// Handle error
return ISM330DLC_STATUS_ERROR;
}
if (ISM330DLC_ACC_GYRO_W_INT2_ON_INT1((void *)this, ISM330DLC_ACC_GYRO_INT2_ON_INT1_ENABLED) != MEMS_SUCCESS) {
// Handle error
return ISM330DLC_STATUS_ERROR;
}

if (ISM330DLC_ACC_GYRO_W_DRDY_XL_on_INT1((void *)this, ISM330DLC_ACC_GYRO_INT1_DRDY_XL_ENABLED) != MEMS_SUCCESS) {
// Handle error
return ISM330DLC_STATUS_ERROR;
}

if (ISM330DLC_ACC_GYRO_W_DRDY_PULSE((void *)this, ISM330DLC_ACC_GYRO_DRDY_PULSE) != MEMS_SUCCESS) {
// Handle error
return ISM330DLC_STATUS_ERROR;
}

I am unable to figure out that which register to use so that more data can be accumulated in a second (such as for 6500 Hz ODR, accelerometer data should be 18000 samples per second).

Assistance will be highly appreciated.

 

 

0 REPLIES 0