cancel
Showing results for 
Search instead for 
Did you mean: 

AIS2DW12 normal functioning

SLEWI.11
Associate

Hi everyone,

I have run into some problems reading any data from the AIS2DW12 and I would like to know if anyone has had the same issue. I can read the Device ID through I2C but I am not able to read acceleration or temperature data. So my question is if by default everything is connected as should be using i2c mode(CS pin SET to vcc), should the accelerometer generate acceleration readings? I am reading the DRDY flag and its reading 0. All my acceleration registers are reading 0.

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @SLEWI.1​ ,

supposing that the I2C is correctly working (i.e. you are receiving an ACK), did you first check the WHO_AM_I (0Fh) register value, that should be 44h?

If so, you need to configure at least the ODR (and the FS) registers. You can refer for example to the C code on Github --> ais2dw12_read_data_polling.c.

The ODR allows data to be available on dataout pad: if you don't configure this, you will not able to see any data (and any DRDY signal).

Here the C code for a complete configuration: power mode and ODR configurations are the most important for starting the device operation.

  /* Enable Block Data Update */
  ais2dw12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
  /* Set full scale */
  ais2dw12_full_scale_set(&dev_ctx, AIS2DW12_2g);
  /* Configure filtering chain
   * Accelerometer - filter path / bandwidth */
  ais2dw12_filter_path_set(&dev_ctx, AIS2DW12_LPF_ON_OUT);
  ais2dw12_filter_bandwidth_set(&dev_ctx, AIS2DW12_ODR_DIV_4);
  /* Configure power mode */
  ais2dw12_power_mode_set(&dev_ctx, AIS2DW12_PWR_MD_12bit);
  /* Set Output Data Rate */
  ais2dw12_data_rate_set(&dev_ctx, AIS2DW12_XL_ODR_25Hz);

If you then want to read synchronously, you have to enable the INT1_ DRDY of the CTRL4_INT1 (23h) register, or if you just want to monito it you have to read in polling mode the DRDY bit of STATUS (27h) register.

If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster. 

-Eleon