STEVAL-MKI208V1K: Error caused by switching on the pulsed mode.
Hi! Since I am not a native speaker, I apologize in advance for my English.
When switching on the pulsed mode strange things start to happen.
Until yesterday I used int1 pad, everything worked fine, but at a certain moment it became necessary to count the ODR in real time and i activated pulsed mode for int2 pad (I am not interested in alternative counting options). I was doing this as it said in datasheet:
-set the dataready_pulsed bit of the COUNTER_BDR_REG1 (0Bh) register to 1
-set int2_drdy_xl bit to 1
/*IIS3DWB interrupt setup register
* \brief acc data-ready interrupt value
*/
static iis3dwb_pin_int2_route_t AccHalIIS3DWBirq2Cfg=
{
.drdy_xl = 1, /* Accelerometer data ready */
.drdy_temp = 0, /* Temperature data ready */
.fifo_th = 0, /* FIFO threshold reached */
.fifo_ovr = 0, /* FIFO overrun */
.fifo_full = 0, /* FIFO full */
.fifo_bdr = 0, /* FIFO Batch counter threshold reached */
.wake_up = 0, /* wake up event */
.sleep_change = 0, /* Act/Inact (or Vice-versa) status changed */
.sleep_status = 0
};and then route set to int2.
Code:
/**
* \brief INT2 dataready pulsed mode setup
* \param[in] no
* \param[out] no
* \return int16_t error code, 0 - no errors
*/
static int16_t accHalInt2DrdySignalSet(void)
{
int16_t status = 0;
status = iis3dwb_data_ready_mode_set(&AccHalIIS3DWBio, IIS3DWB_DRDY_PULSED);
if(status) return -1; //Exit: error code -1: pulsed mode setting error
/* Sending parameters to int2 register */
status = iis3dwb_pin_int2_route_set(&AccHalIIS3DWBio, &AccHalIIS3DWBirq2Cfg);
if(status) return -2; //Exit: error code -2: int2 route set failed
return 0; //Exit: 0 - no errors.
}I do not use this interrupt anywhere and the MCU does not know about this pad. I want interrupt1 to work as before to read data, and on int2 pad there were pulses to count the ODR, but then after a random period of time, int2 stops pulsing or the signal disappears on both pads. The only interrupt source for int1 pad is the fifo_th_bit of the int1_ctrl register. I call function accHalInt2DrdySignalSet(); only once in init sequence.
Any ideas?
