<?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>Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12337/help-my-project-can-not-exit-the-gpio-interrupt-handler</link><description>HI,ALL 
 my Project can not exit the GPIO INTERRUPT HANDLER. 
 following is my project. 
 include &amp;quot;nrf_gpio.h&amp;quot;

include &amp;quot;nrf52.h&amp;quot;

include &amp;quot;boards.h&amp;quot;


define BUTTON_1 13
define LED_1 17

void delay_my(void);
int main(void)
{
	
	nrf_gpio_pin_pull_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Mar 2016 09:27:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12337/help-my-project-can-not-exit-the-gpio-interrupt-handler" /><item><title>RE: Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/thread/46675?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2016 09:27:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7725c21-bf89-425e-ade5-a679c5caac16</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;TASK_CLR will not affect the event, it is just not necessary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/thread/46676?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2016 09:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0996d11b-5a41-421b-99b2-409d971c785f</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You must configure the pin as an input and use internal pullup.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_input(BUTTON_1, NRF_GPIO_PIN_PULLUP);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The input is by default disconnected and without the pullup the pin will float when the button is not pushed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/thread/46674?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 07:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:462bf006-6d13-45c5-a942-e36a018b566e</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;I was just thinking, maybe the fact you are wriing to the TASK_CLR on an event configured GPIOTE channel is triggering the EVENT_IN[0] again, not really sure though. The order you do this is should also not have this effect. ;)&lt;/p&gt;
&lt;p&gt;The tasks CLR SET and OUT are only used when the channel is set to TASK mode, not EVENT mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/thread/46673?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 07:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c58fa45-9e90-42e0-bf42-3cd4b16d2c9d</guid><dc:creator>bernerd</dc:creator><description>&lt;p&gt;thank you for your suggestion.
and i think that the  statement
NRF_GPIOTE-&amp;gt;EVENTS_IN[0] = 0; [//Event generated from pin specified in CONFIG[0].PSEL]
may exit the handler? but why not?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help, my Project can not exit the GPIO INTERRUPT HANDLER.</title><link>https://devzone.nordicsemi.com/thread/46672?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 07:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7241c3c5-2b67-40bd-a211-0d7e14044c32</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;first of all, why don&amp;#39;t you use the definitions provided by nordic?&lt;/p&gt;
&lt;p&gt;second, you don&amp;#39;t need to clear any tasks, they just run once when you write 1 to them.&lt;/p&gt;
&lt;p&gt;thirth, in the &amp;#39;migratinf from nrf51 to nrf52&amp;#39; document is sais the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Interrupt event clearing
Clearing an interrupt event may not take effect immediately.
As Cortex&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/00ae.svg" title="Registered"&gt;&amp;#x00ae;&lt;/span&gt;
-M4F has a write buffer on the system bus, write accesses to peripherals/SRAM may be delayed.
In addition, there can be other delays in the bus infrastructure, such as bridges, that may result in writes
occurring after the store instruction has been completed.
To make sure the interrupt line is cleared before exiting an ISR, read back the given event register before
returning. Any read on the system bus will require the write buffer to be emptied first.
Existing code:

    void TIMER0_IRQHandler(void)
    {
     NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0] = 0;
    }

Required code:

    void TIMER0_IRQHandler(void)
    {
     NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0] = 0;
     (void)NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0];
    }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>