AnsweredAssumed Answered

FreeFall Detection

Question asked by Claudia Andrea Rojas Márquez on Sep 14, 2016
Latest reply on Sep 16, 2016 by Claudia Andrea Rojas Márquez

Tengo problemas con mi código para el acelerómetro FXOS8700CQ, deseo generar una interrupción por FreeFall pero no se genera, no se si sea necesario configurar otro registro que no haya hecho, esta es la función para inicializar el sensor que he estado utilizando:

 

void FXOS8700CQ1_Init(void)
{
//Reset all registers to POR values
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x40);
//delay
Pause(0x400);

// +/-2g range with 0.244mg/LSB
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, XYZ_DATA_CFG_REG, 0x00);
//1ms delay
Pause(0x100);

#if FREEFALL_DETECTION
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, FF_MT_CFG_REG, 0xB8); // Freefall detection for X and Y and Z axis
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, FT_MT_THS_REG, 0x03); // Threshold Setting Value for the Freefall detection of < 0.2g (0.2g/0.064g = 3.17 counts)
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, FF_MT_COUNT_REG, 0x0C); // Set the debounce counter to 100 ms timer (120ms/100Hz = 12 counts)
#endif

//Only accelerometer sensor is active
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG1, 0x00);

//High Resolution mode
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x02);

//Push-pull, active low interrupt
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG3, 0x00);

//Enable DRDY interrupt
//Enable Freefall interrupt
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG4, 0x05);

I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG5, 0x05);

//ODR= 3.125Hz Reduced noise, Active mode
I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x35);
}

Outcomes