Unable to handle the data ready interrupt for mma8653

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Unable to handle the data ready interrupt for mma8653

跳至解决方案
1,663 次查看
AMBh
Contributor I

In the mma8452.c driver code provided in linux they have mentioned one note i.e.

/* * Although we enable the interrupt sources once and for * all here the event detection itself is not enabled until * userspace asks for it by mma8452_write_event_config() */

 

I am trying to interface mma8653 with imx8-mini I could not able to understand how I would get interrupt on INT1 or INT2 pin by using this driver code. Is anyone could provide some details or any documentation

标签 (1)
0 项奖励
回复
1 解答
1,652 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Madhuri,

Unfortunately I am not familiar with this driver and do not know who is the author, but I think what this note is trying to say is that in order to enable any of the four available interrupt functions, not only the corresponding INT_EN_x (CTRL_REG4) and INT_CFG_x (CTRL_REG5) bits need to be configured, but also the function itself need to enabled and configured.

Let’s assume for example the motion function. If you want a motion event to generate an interrupt, the motion detection needs to be enabled by setting the OAE bit in the FF_MT_CFG register. Then it is necessary to configure the motion threshold and debounce time using FF_MT_THS and FF_MT_COUNT registers. Finally you need to set the INT_EN_FF_MT bit in the CTRL_REG4 register and set/clear the INT_CFG_FF_MT bit in the CTRL_REG5 register depending on which interrupt pin you want to use for this function.

Interrupt.JPG

Best regards,

Tomas

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,605 次查看
AMBh
Contributor I

Yes I am able to successfully handle the interrupt. Thank you Tomas for your information.

0 项奖励
回复
1,653 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Madhuri,

Unfortunately I am not familiar with this driver and do not know who is the author, but I think what this note is trying to say is that in order to enable any of the four available interrupt functions, not only the corresponding INT_EN_x (CTRL_REG4) and INT_CFG_x (CTRL_REG5) bits need to be configured, but also the function itself need to enabled and configured.

Let’s assume for example the motion function. If you want a motion event to generate an interrupt, the motion detection needs to be enabled by setting the OAE bit in the FF_MT_CFG register. Then it is necessary to configure the motion threshold and debounce time using FF_MT_THS and FF_MT_COUNT registers. Finally you need to set the INT_EN_FF_MT bit in the CTRL_REG4 register and set/clear the INT_CFG_FF_MT bit in the CTRL_REG5 register depending on which interrupt pin you want to use for this function.

Interrupt.JPG

Best regards,

Tomas

0 项奖励
回复
1,586 次查看
AMBh
Contributor I

Hi, I do have one more doubt I want to generate interrupt only once after change in orientation but it seems like it occurs more than three four times.

Is this debounce issue if so how to resolve this because I am not getting how to use PL_COUNT register to handle this issue.

0 项奖励
回复