<?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>Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62325/delay-in-sense-interrupt</link><description>Our setup is using a NRF52832 with SDK15.0.0. 
 
 While working with a time sensitive external circuit where we both sample the state of the GPIO and enable LDETECT on it, we noticed that the sampling code detects a transition in pin state much faster</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jun 2020 07:44:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62325/delay-in-sense-interrupt" /><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254380?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 07:44:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6842beff-e2b7-4fd6-8a29-9f50fcc78741</guid><dc:creator>Kenneth</dc:creator><description>[quote user="Alex Crombie"]I will have a look at the example[/quote]
&lt;p&gt;If you are able to recreate the same by modifying&amp;nbsp;&lt;span&gt;\examples\peripheral\pin_change_int\&amp;nbsp;&lt;/span&gt;&lt;span&gt;, please share the program so I can recreate it here also to look into it further.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254375?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 07:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e2a74d0-106d-4ce9-90e2-db64af653427</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;During the ~24ms it does show a consistent high value, there does not appear to be any jitter in the signal. The sampling period is 125uS so maybe this period is too long to notice any jitter.&lt;/p&gt;
&lt;p&gt;The GPIOTE interrupt handler does process all of our inputs however it is designed to execute as fast as possible and only adds an event into the event queue for each input. In addition to this there should have been no changes in the other inputs as they were not being handled. Furthermore this behaviour is consistent across each cycle (100ms) of the pulse detection in the external circuit.&lt;/p&gt;
&lt;p&gt;I will have a look at the example&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254262?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 12:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abb8ce36-3b02-4d56-b310-0b9fad4161ca</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Maybe you need to try to modify a simplified example like &lt;span&gt;\examples\peripheral\pin_change_int\&amp;nbsp;&lt;/span&gt;to see if you can observe the same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you know if the polling show a consistent logic high signal during the ~24ms period. I am just thinking maybe it is sporadic high during ramp up of pin, while sense may require a few clock cycles consistent high before it trigger the interrupt.&lt;/p&gt;
&lt;p&gt;If you have an RTC running, you could just try to log whenever there is a change in polling, and see if it is intermittently high during the pin ramp-up.&lt;/p&gt;
&lt;p&gt;Is it possible that the gpiote interrupt handler is processing another gpio here at the same time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254219?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 10:48:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bc83d91-8f7a-471b-87e8-3d80114c1a0e</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;Unfortunately due to the lockdown situation it turns out I can&amp;#39;t actually get the oscilloscope trace. My apologies for the wrong information&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254186?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 09:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc89b9f8-1c81-486e-8a4d-06ce2132a742</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;1) Because our devices have multiple inputs we do not really have the option to not use the Latched Detection method as we need to know which pin was the one that triggered the interrupt. Having said that when writing a timed polling of the pin, where we read the value directly from the registers we notice it going high ~24ms before the interrupt arrives.&lt;/p&gt;
&lt;p&gt;2) We have not measured this case as previously we did not have any external circuit where precise timing was a requirement and a delay of ~25ms in button detection is not noticeable. I can try and measure this for you.&lt;/p&gt;
&lt;p&gt;3) I can get a new trace for you.&amp;nbsp;We have traces from previous products using the same circuit which is how we know the expected behaviour&lt;/p&gt;
&lt;p&gt;4) The GPIO is pin 16&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254175?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 08:41:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded5bf70-47ab-4776-aeda-4ab8cc73291b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Some question that may help me understand;&lt;/p&gt;
&lt;p&gt;- If you are not using&amp;nbsp;&lt;span&gt;LDETECT, then I assume the result is the same.&lt;br /&gt;- If you are using logic high fast ramp up (&amp;lt;1us) on input, do you see the same delay then?&lt;br /&gt;- Do you have any oscilloscope&amp;nbsp;trace of the input?&lt;br /&gt;- What GPIO pin# are you using as an input here?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254054?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 13:07:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22725078-7035-4d92-aeac-7067bf89d760</guid><dc:creator>Alex Crombie</dc:creator><description>&lt;p&gt;LDETECT is being setup directly by writing to the registers:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_P0-&amp;gt;DETECTMODE = LATCH_DETECT_MODE;
NRF_GPIOTE-&amp;gt;INTENCLR = GPIOTE_INTENCLR_PORT_Msk;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The pins are configured using the nrf_gpio library. Specifically we are configuring the pin using nrf_gpio_cfg_sense_input().&lt;/p&gt;
&lt;p&gt;The interrupt handler is directly implemented&amp;nbsp;using GPIOTE_IRQHandler().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay in sense interrupt</title><link>https://devzone.nordicsemi.com/thread/254025?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 11:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a361d35-a85a-4c33-a996-9c3b694c6540</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;What library or driver are you using to setup sense? I do not think any of the libraries are using&amp;nbsp;&lt;span&gt;LDETECT due to backwards compatibility.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you looked at:&amp;nbsp;\examples\peripheral\pin_change_int\ for comparison?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>