<?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>Why does the GPIOTE event not link to the GPIOTE task via PPI though the event handler works?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10538/why-does-the-gpiote-event-not-link-to-the-gpiote-task-via-ppi-though-the-event-handler-works</link><description>I was learning GPIOTE using the example provided in SDK 9.0.0. (examples\peripheral\gpiote). The example only uses GPIOTE task and a timer to drive the task through PPI. 
 So I created a similar function (pasted below) that is meant to link a GPIOTE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Dec 2015 11:38:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10538/why-does-the-gpiote-event-not-link-to-the-gpiote-task-via-ppi-though-the-event-handler-works" /><item><title>RE: Why does the GPIOTE event not link to the GPIOTE task via PPI though the event handler works?</title><link>https://devzone.nordicsemi.com/thread/39207?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2015 11:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9252f814-d5d5-4e00-89b2-2597dbeab138</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You should also add pullup on the pin:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;event_config.pull = NRF_GPIO_PIN_PULLUP;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does the GPIOTE event not link to the GPIOTE task via PPI though the event handler works?</title><link>https://devzone.nordicsemi.com/thread/39208?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2015 11:59:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db2f389b-8b33-4da3-9224-6f23a177b532</guid><dc:creator>Johnson</dc:creator><description>&lt;p&gt;Thanks Ole. I added a capacitor (1 uF) across the button. It resolved the bouncing issue.&lt;/p&gt;
&lt;p&gt;It still have one question:&lt;/p&gt;
&lt;p&gt;Why does the PPI only work after setting the GPIOTE event to high accuracy?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_gpiote_in_config_t event_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does the GPIOTE event not link to the GPIOTE task via PPI though the event handler works?</title><link>https://devzone.nordicsemi.com/thread/39210?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 12:42:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c36efcd4-4ef5-4d8c-806e-f464a94c507a</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You may be experiencing button bounce. The button will generate fast transitions between Vdd and GND before settling, this may be read as multiple button presses. Since you are toggling a LED, it may switch on and off multiple times and if the number of times is odd you will see a change, if the number of times is even you will not see a change. A normal debounce procedure in code is to start a timer when the button is pushed and then read the input after a certain amount of time. Do a quick search for &amp;quot;debounce button&amp;quot; on google for more information.&lt;/p&gt;
&lt;p&gt;Regarding the low accuracy not working, this is because low accuracy means that the driver uses PORT event instead of IN events. You are configuring the PPI to connect the gpiote IN event to the task. Change to this if you want to use PORT event (it seems like it is not supported by the driver so have to use register):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = nrf_drv_ppi_channel_assign(ppi_channel, (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;EVENTS_PORT, gpiote_task_addr);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem with the PORT event is that it is shared between all pins that has sense enabled. You can read more about the PORT event and SENSE functionality in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.pdf.rm/nRF51_RM_v3.0.pdf"&gt;Reference Manual&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why does the GPIOTE event not link to the GPIOTE task via PPI though the event handler works?</title><link>https://devzone.nordicsemi.com/thread/39209?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2015 11:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9599d357-b3f9-40b1-b8bb-3ee8c4c5908e</guid><dc:creator>Johnson</dc:creator><description>&lt;p&gt;Hmm, it worked after I set the GPIOTE event to high accuracy.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  nrf_drv_gpiote_in_config_t event_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also it seemed that the button is not as responsive as it should be in either case.&lt;/p&gt;
&lt;p&gt;Is there anything wrong in the code that makes the button randomly unresponsive?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>