<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Missing interrupt sometimes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13488/missing-interrupt-sometimes</link><description>Hello all, 
 I am using the nrf51822 chip as well as an accelerometer LIS3DH. The device does advertising and turns on a LED when it is active. 
 The accelerometer is configured to detect when the device has not been moved for 2 minutes. When this happens</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 May 2016 09:16:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13488/missing-interrupt-sometimes" /><item><title>RE: Missing interrupt sometimes</title><link>https://devzone.nordicsemi.com/thread/51478?ContentTypeID=1</link><pubDate>Fri, 13 May 2016 09:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fa97904-1832-401a-9323-771399863a21</guid><dc:creator>dblasco</dc:creator><description>&lt;p&gt;After some days trying this, I think the problem has been solved by using the gpiote library.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing interrupt sometimes</title><link>https://devzone.nordicsemi.com/thread/51477?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 10:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97060595-ab8e-439e-92b8-d3125c107498</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;button handler is designed keeping button mechanics in mind. I think it should work if you make debounce delay to 0, but even then why do you want to have so much overhead for your interrupt? Everytime there is an interrupt, the button handler library is run just to pass the interrupt to your handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing interrupt sometimes</title><link>https://devzone.nordicsemi.com/thread/51476?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 10:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f43717bf-d9eb-49ed-801f-9364e916560d</guid><dc:creator>dblasco</dc:creator><description>&lt;p&gt;Hi Aryan,&lt;/p&gt;
&lt;p&gt;thank you for your response. I will try using the code you provided. I will tell the results.
May I ask why the button handler is not ok? Even changing the delay debounce to 0?&lt;/p&gt;
&lt;p&gt;Yes, I think there is no problem with the accelerometer.&lt;/p&gt;
&lt;p&gt;I am sleeping by means of sd_app_evt_wait().&lt;/p&gt;
&lt;p&gt;The application is always sleeping, and it awakes when any handler comes up (advertising, timer, ...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing interrupt sometimes</title><link>https://devzone.nordicsemi.com/thread/51475?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2016 09:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23e5b6f5-a0e5-4c77-b3ab-5d2a5b31e61d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi dblasco,
Why are you using button library for initializing the interrupt? most likely your problem is because of using button library and have detection delay. Can you set detection delay to 0 and see what happens? I still do not like using button handler instead use something like below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void gpio_init(void)
{
    ret_code_t err_code;

    if (!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }

    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
    in_config.pull = NRF_GPIO_PIN_PULLDOWN;

    err_code = nrf_drv_gpiote_in_init(SENSOR_INT_PIN, &amp;amp;in_config, sensor_int_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_in_event_enable(SENSOR_INT_PIN, true);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This above code is for SDK10 and i have not ported it to SDK11 but i am assuming it should not change (too much)&lt;/p&gt;
&lt;p&gt;I have tried using LIS2DH and it works perfectly fine for me.
You said that you have verified that the accelerometer does fire interrupt when it is moving. This means that the configuration of that sensor probably is correct. How are you sleeping in the application? are you using sd_app_Evt_Wait or __WFE or __WFI?&lt;/p&gt;
&lt;p&gt;I would like to see how you are sleeping (does your application sleep on condition?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>