AnsweredAssumed Answered

KL17 and fxos8700 pulse interrupt

Question asked by sripada kasi viswanadh on Sep 11, 2018
Latest reply on Sep 12, 2018 by Tomas Vaverka

Hi,This is kasi viswanadh

I'm using kl17 MCU and FXOS8700 acc+mag combo sensor in my project.  im using pulse interrupt in my code and i'm reading interrupt like below,

 

 

void PulseINTService(Motiontrack *hApp) {
int32_t status;
uint8_t Int_SourceSystem, Int_SourceTrans;

//Determine source of interrupt by reading the system interrupt register
status = Register_I2C_Read(&I2C_S_DRIVER_BLOCKING,
FXOS8700_DEVICE_ADDR_SA_00, FXOS8700_INT_SOURCE, 1, &Int_SourceSystem);
if (status != 0x00)
hApp->thisTrigger.pulseint = true;
else
hApp->thisTrigger.pulseint = false;
//Set up Case statement here to service all of the possible interrupts
if ((Int_SourceSystem & 0x08) == 0x08) {
//Perform an Action since pulse Flag has been set
//Read the pulse to clear system interrupt and pulse
status = Register_I2C_Read(&I2C_S_DRIVER_BLOCKING,
FXOS8700_DEVICE_ADDR_SA_00, FXOS8700_PULSE_SRC, 1, &Int_SourceTrans);
if (status != 0x00)
hApp->thisTrigger.pulseint = true;
else {
hApp->thisTrigger.pulsecnt++;
hApp->thisTrigger.pulseint = false;
}

 

}
}

I've connected 2 more devices(gyro and battery gauge) to the mcu with same i2c. my system is hanging and coming back to normal state after some time. is there any fault in the above code? or any other possibilities for the hanging issue?

 

 

Thank you

Outcomes