AnsweredAssumed Answered

LSM6DS0 failing to generate interrupt

Question asked by Donato Catenazzo on Jul 2, 2017

Hi everyone,
we are working the the LSM6DS0 from ST interfacing through SPI with a CC2650 microcontroller. We have been able to test our custom PCB, read some data from the accelerometer, but we are not able to configure the interrupt generation (neither from OUTPUT data available neither from threshold high event detected)
We have a couple of doubts, since there are no resources online about the PCB electrical connection. Should the interrupt pin be connected directly to the input GPIO of the uC? Should we use some pull up, pull down?

 


Here we report the dump of all the registers we read on our debugger together with a synthetic description of all our configurations.
ALL REGS DUMP (obtained through SPI, after some time):
[0] '\x00'
[1] '\x00'
[2] '\x00'
[3] '\x00'
[4] '\x00'
[5] '\x00'
[6] '\6a'
[7] '\x32'
[8] '\x32'
[9] '\x32'
[10] '\xfd'
[11] '\x00'
[12] '\x41'
[13] '\x00'
[14] '\x00'
[15] '\x68'
[16] '\x00'
[17] '\x00'
[18] '\x00'
[19] '\x00'
[20] '\x00'
[21] '\x3e'
[22] '\x00'
[23] '\x01'
[24] '\x19'
[25] '\x03'
[26] '\xe6'
[27] '\xff'
[28] '\x91'
[29] '\xff'
[30] '\x38'
[31] '\x38'
[32] '\x40'
[33] '\x00'
[34] '\x04'
[35] '\x00'
[36] '\x00'
[37] '\x00'
[38] '\x20'
[39] '\x01'
[40] '\x9e'
[41] '\xff'
[42] '\xb2'
[43] '\xf3'
[44] '\xa5'
[45] '\x3e'
[46] '\x00'
[47] '\x00'
[48] '\x00'
[49] '\x00'
[50] '\x00'
[51] '\x00'
[52] '\x00'
[53] '\x00'
[54] '\x00'

 

Here a piece of code which highlights the configuration of registers we used:

 

{ //Setting thresholds to 50
writeReg8 (LSM6DS0_XG_INT_GEN_THS_X_XL, ACC_THRESHOLD);    // Write threshold of x-axis
writeReg8 (LSM6DS0_XG_INT_GEN_THS_Y_XL, ACC_THRESHOLD);    // Write threshold of y-axis
writeReg8 (LSM6DS0_XG_INT_GEN_THS_Z_XL, ACC_THRESHOLD);    // Write threshold of z-axis

writeReg8 (LSM6DS0_XG_INT_GEN_DUR_XL, ENABLE_MSB | SAMPLES_TO_WAIT);    //Enables the waiting and  sets how many samples_to_wait before exiting interrupt (125, in our case)
writeReg8 (LSM6DS0_XG_INT_CTRL, INT_IG_XL | INT_DRDY_XL);                                    //Accelerometer interrupt generator on INT pin (INT_IG_XL bit) and generate interrupt when data is ready (INT_DRDY_XL bit)


writeReg8 (LSM6DS0_XG_CTRL_REG5_XL, LSM6DS0_XL_XEN_ENABLE | LSM6DS0_XL_YEN_ENABLE | LSM6DS0_XL_ZEN_ENABLE);    //Enable interrupts on channel x, y and z
writeReg8 (LSM6DS0_XG_CTRL_REG6_XL, LSM6DS0_XL_ODR_50HZ| LSM6DS0_XL_FS_2G);    //ODR and Full  Scale selection
writeReg8 (LSM6DS0_XG_INT_GEN_CFG_XL, EN_6D | ZHIE_XL | YHIE_XL | XHIE_XL );    //enable 6D and threshold higher than ACC_THRESHOLD

}

 


Is something missing, because we are not able to see any interrupt coming from the accelerometer? Please notice how , in the STATUS_REG (27h, [39]), the Interrupt event flag (IG_XL) is always zero, while the data available flag (XLDA) stays at one. For the other aspects, all functionalities of the accelerometer seem to work properly.

We also checked that our code on the microcontroller is able to detect and run an ISR coming from a specific GPIO pin.

Any help, suggestion, resources will be much appreciated. Thank you very much for your answers!

Outcomes