AnsweredAssumed Answered

LIS2DH12 data ready interrupt

Question asked by huang.frank.007 on Nov 14, 2016
Latest reply on Nov 30, 2016 by Miroslav B
Hi,

I want the most basic function -- data ready interrupt, but it seems not so easy to come out. Here are my configurations:

void lis3dh_init(void)
{
  //Inizialize MEMS Sensor
     lis3dh_reset();
  //set ODR (turn ON device)
  LIS3DH_SetODR(LIS3DH_ODR_50Hz);
  //set PowerMode 
  LIS3DH_SetMode(LIS3DH_NORMAL);
  //set Fullscale
  LIS3DH_SetFullScale(LIS3DH_FULLSCALE_4);
  //set axis Enable
  LIS3DH_SetAxis(LIS3DH_X_ENABLE | LIS3DH_Y_ENABLE | LIS3DH_Z_ENABLE);
     LIS3DH_SetInt1Pin(LIS3DH_CLICK_ON_PIN_INT1_DISABLE | LIS3DH_I1_INT1_ON_PIN_INT1_DISABLE |
                                                  LIS3DH_I1_INT2_ON_PIN_INT1_DISABLE | LIS3DH_I1_DRDY1_ON_INT1_ENABLE | LIS3DH_I1_DRDY2_ON_INT1_DISABLE |
                                                  LIS3DH_WTM_ON_INT1_DISABLE | LIS3DH_INT1_OVERRUN_DISABLE   );
     //initialize the pedometer 
     IntPedomter();
}

void get_acc_data(void)
{
     if(!g_int_triggered) return;
     AxesRaw_t data;
     LIS3DH_GetAccAxesRaw(&data);/* Read the accel XYZ data*/
     ****_SampWrite(((data.AXIS_X)>>6)<<3, ((data.AXIS_Y)>>6)<<3, ((data.AXIS_Z)>>6)<<3);
//     PRINTF("%d\t%d\t%d\n", (data.AXIS_X)/8, (data.AXIS_Y)/8, (data.AXIS_Z)/8);
}

And I've already configure the INT1 pin as a low-to-high edge triggered pin. But when I use the oscilloscope to get the waveforms, it is a straight line, I cannot see any change from it. And also cannot get any acceleration data.

So my question is how to configure the data ready interrupt correctly? Thank you.

Outcomes