<?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>GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95126/gpiote-interrupts-missed</link><description>Hi, 
 
 I am testing GPIOTE interrupts on 833, and noticed the interrupt is not fired sometimes (randomly) on power up. The input level did change as measured but the interrupt is not seen. I am not quite sure the reason behind yet, but I would like to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Dec 2022 15:07:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95126/gpiote-interrupts-missed" /><item><title>RE: GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/thread/402108?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 15:07:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a643278b-abc0-45ae-97f4-502a7e50e819</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;No, that should not be the case. The behavior is that it is edge triggered, but&amp;nbsp;that does not mean that it has to sample during the transition. Rather, it means that the event/interrupt is generated on transitions(if one sample is 1 and the next is 0 there was a transition), and not a steady level.&lt;/p&gt;
&lt;p&gt;PS: I am off for Christmas holiday now so I will not be&amp;nbsp;able&amp;nbsp;to reply back to this thread until next year. If you need assistance next week, then please open a new case and refer to this one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/thread/402096?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 14:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d2e729c-5398-4b7e-a152-7379a7e892ea</guid><dc:creator>rolandash</dc:creator><description>&lt;p&gt;As you mentioned above, the GPIOTE is edge triggered. So I am thinking if this case can happen that, for some reason 833 detection missed the edge (for example the&amp;nbsp;HFCLK issue?), so after that even the level did have changed to 0 but the interrupt will not happen?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/thread/402093?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 13:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d77e3626-ce67-46ec-a9ea-57699958d93a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. This is most peculiar. In the scenario you describe there is ample time between the pin getting configured and the transition to 0, and everything is slow so it should be good. Some generic thoughts that might be irrelevant but it could be good to rule out:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Could there be that for some reasons in som cases your app ends up spending all CPU time in a higher priority interrupt, preventing servicing of the GPIOTE interrupt?&lt;/li&gt;
&lt;li&gt;Another issue in your firmware that makes it seem like the interrupt does not occur. How have you verified that this is what happens?&lt;/li&gt;
&lt;/ol&gt;
[quote user="rolandash"]Or is it possible that the input signal glitches or bouncing may cause 833 GPIO detect fail?[/quote]
&lt;p&gt;If the signal is 0 (defined as below 0.3 x VDD9) for an extremely short period of time then that would be a theoretical possibility, but if not this should worst case give you multiple events instead (if the ripple si so high that there are several transactions up and down).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/thread/402079?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 13:02:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95550776-113f-4194-9ce1-8f9162068072</guid><dc:creator>rolandash</dc:creator><description>&lt;p&gt;Thank you &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp; for the quick reply in holiday season!&lt;/p&gt;
&lt;p&gt;Below is my initialization code to config GPIOTE interrupt, quite straightforward I think&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrfx_gpiote_in_config_t in_config = NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
    //in_config.pull = NRF_GPIO_PIN_PULLUP;
    ret_code_t err_code;
    if(!nrfx_gpiote_is_init())
    {
        err_code = nrfx_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }
    err_code = nrfx_gpiote_in_init(DT_IO_EXP_INT_PIN, &amp;amp;in_config, &amp;amp;dt_tec_io_exp_irq_handler);
    APP_ERROR_CHECK(err_code);
        
    nrfx_gpiote_in_event_enable(DT_IO_EXP_INT_PIN, true);
    
    //Check if already an INT from input, before we set everything up.
    uint8_t int_pin_val = nrf_gpio_pin_read(DT_IO_EXP_INT_PIN);
    
    //and value of int_pin_val is 1 as measured (3.3V)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;According to my profiling, the enabling of GPIOTE event got executed at about 2ms after power up. And immediately&amp;nbsp;after the enabling, the read of the int pin always printed out of&amp;nbsp;1 (also confirmed by measuring 3.3V).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The input level change to low happens around 50ms after power up, also confirmed by measuring a 0V. Theoretically for whatever happens in between the time gap and the level transition, I should at least get an interrupt. But for somehow this just randomly been lost.&lt;/p&gt;
&lt;p&gt;I asked for a very slow slope case not because the input signal is varying this slow, it actually should be instant. Just because it is a really weird issue so I am guessing &lt;span&gt;this might be happening&amp;nbsp;&lt;/span&gt;for some very exceptional reason.&lt;/p&gt;
&lt;p&gt;Or is it possible that the input signal glitches or bouncing may cause 833 GPIO detect fail?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupts missed?</title><link>https://devzone.nordicsemi.com/thread/402074?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 12:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d257bfa0-3e86-4c46-9fe3-7b4a0dd43d62</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As you specify true with&amp;nbsp;NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO, you use GPIOTE, and the interrupt will be edge triggered. As you write that this issue only happens during startup I wonder if there could be something timing related here, for instance that the transition sometimes happens before the input pin with interrupt is enabled?&lt;/p&gt;
&lt;p&gt;Also, if the transition is as slow as you write, perhaps it would make more sense to use a comparator (COMP/LPCOMP) instead of GPIOTE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>