Making interrupt output on int1 or int2 pin of FXOS8700CQ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Making interrupt output on int1 or int2 pin of FXOS8700CQ

Jump to solution
542 Views
muzahid13
Contributor I

Hi There,

I am trying to get interrupt output when the FXOS8700CQ sensor is moved, but anyhow i cannot do this. i did setup the register perfectly. please check my following register setup:

void FXOS8700CQ_Init(void)
{
FXOS8700CQ_writeReg(FXOS8700_REGISTER_CTRL_REG2, 0x40); // Reset all registers to POR values
__delay_ms(1);
FXOS8700CQ_writeReg(FXOS8700_REGISTER_XYZ_DATA_CFG, 0x00); // +/-2g range with 0.244mg/LSB
FXOS8700CQ_writeReg(FXOS8700_REGISTER_MCTRL_REG1, 0x1F); // Hybrid mode (accelerometer + magnetometer), max OSR
FXOS8700CQ_writeReg(FXOS8700_REGISTER_CTRL_REG2, 0x00); // High Resolution mode
FXOS8700CQ_writeReg(FXOS8700_REGISTER_CTRL_REG3, 0x02); // Push-pull, active High interrupt
FXOS8700CQ_writeReg(FXOS8700_REGISTER_CTRL_REG4, 0x1D); // DRDY, Freefall/Motion, P/L and tap ints enabled
FXOS8700CQ_writeReg( FXOS8700_REGISTER_CTRL_REG5, 0x00); // all interrupt on INT2
FXOS8700CQ_writeReg( FXOS8700_REGISTER_CTRL_REG1, 0x35); // ODR = 3.125Hz, Reduced noise, Active mode

}

I only configure the above register to get interrupt output on INT2 pin that fed to main MCU, i did not configure the other register,  do i need to configure other register to get interrupt. please suggest me.  i am trying for last 4 days and searched on google how to solve this. but not solved yet. can anyone please help me to solve this. thanks.

0 Kudos
1 Solution
529 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Muzahidul,

Yes, you need to enable and configure the corresponding functions.

For instance for the P/L detection, you need to configure registers 0x11 – 0x14.

Here is an example for magnetic-field detection function.

And here for the motion detection, but on the FXLS8471 accelerometer.

Best regards,

Tomas

 

View solution in original post

0 Kudos
3 Replies
530 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Muzahidul,

Yes, you need to enable and configure the corresponding functions.

For instance for the P/L detection, you need to configure registers 0x11 – 0x14.

Here is an example for magnetic-field detection function.

And here for the motion detection, but on the FXLS8471 accelerometer.

Best regards,

Tomas

 

0 Kudos
506 Views
muzahid13
Contributor I

Finally it worked. I put a wrong address on "A_VECM_CFG". It should be 0x5F. But earlier i put 0xF5. 

Thanks a lot. 

0 Kudos
513 Views
muzahid13
Contributor I

I followed your instruction and configured the Register. but same here, no interrupt generated.

 

 

void FXOS8700CQ_Init(void)
{

FXOS8700CQ_writeReg(CTRL_REG2, 0x40); // Reset all registers to POR values
__delay_ms(1);
FXOS8700CQ_writeReg( A_VECM_THS_MSB, 0x84 ); //a change in tilt angle exceeding 17.25° from the horizontal plane
FXOS8700CQ_writeReg( A_VECM_THS_LSB, 0xCC);
FXOS8700CQ_writeReg( A_VECM_CNT, 0x01);
FXOS8700CQ_writeReg( A_VECM_INITX_MSB, 0x00 );
FXOS8700CQ_writeReg( A_VECM_INITX_LSB, 0x00 );
FXOS8700CQ_writeReg( A_VECM_INITY_MSB, 0x00 );
FXOS8700CQ_writeReg( A_VECM_INITY_LSB, 0x00 );
FXOS8700CQ_writeReg( A_VECM_INITZ_MSB, 0x10 );
FXOS8700CQ_writeReg( A_VECM_INITZ_LSB, 0x00 );
FXOS8700CQ_writeReg( A_VECM_CFG, 0x78 );
FXOS8700CQ_writeReg(CTRL_REG3, 0x02); //Active high interrupt, push pull int
FXOS8700CQ_writeReg( CTRL_REG4, 0x02 ); //Acceleration vector-magnitude interrupt enable
FXOS8700CQ_writeReg( CTRL_REG5, 0x02); // interrupt output on INT2 pin
FXOS8700CQ_writeReg( M_CTRL_REG1, 0x1F ); //
FXOS8700CQ_writeReg( M_CTRL_REG2, 0x20 );
FXOS8700CQ_writeReg( CTRL_REG1, 0x19 );

}

 

please check the above register setup is okay or not. 

I followed the below shared google drive document found in your website.

https://drive.google.com/file/d/1jINKHOWcjVGrsjnu1sW_MQGI6hWEBLVU/view?usp=drivesdk.

thanks

 

0 Kudos