<?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>How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77942/how-to-use-gpio-09-gpio-10-nrf52840-as-gpio-interrupt</link><description>Dear support team, 
 I would like to use GPIO 09/10 as a GPIO interrupt. 
 I just searched and I see that need to define CONFIG_NFCT_PINS_AS_GPIOS. 
 But I can&amp;#39;t do it. Please help! 
 P/s: I use nrf52840 with segger embedded. 
 
 Thanks and regards, </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Aug 2021 11:43:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77942/how-to-use-gpio-09-gpio-10-nrf52840-as-gpio-interrupt" /><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/325091?ContentTypeID=1</link><pubDate>Mon, 16 Aug 2021 11:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dedb0d1a-86de-4756-8d9b-1de2d86fc493</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Can you read back the content of uicr by calling:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1629114194859v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Upload the uicrdump.hex file here.&lt;/p&gt;
&lt;p&gt;You can install nrfjprog by downloading nRF Command Line Tools.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322955?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 16:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8b2b1b1-efd4-497e-b01e-94c4c4cccd24</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;My issue is when I pressed the button, the GPIO interrupt does not happen.&lt;/p&gt;
&lt;p&gt;I am sure that my hardware is worked. Because when I change to another pin, GPIO interrupts worked fine.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;John&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322954?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 16:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2f08e8d-75d5-4887-8ae2-208c3c65dc91</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;Hi, could you help me this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322738?ContentTypeID=1</link><pubDate>Sat, 31 Jul 2021 02:30:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3994d16d-f081-410e-a202-b09db3d50951</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My issue is when I pressed the button, the GPIO interrupt does not happen.&lt;br /&gt;I am sure that my hardware is worked. Because when I change to another pin, GPIO interrupts worked fine.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;John&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322624?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 09:59:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5146a15e-5ead-403d-9983-a2ec0041ec32</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;I cannot see anything wrong with the way you are initializing GPIO interrupts. However, it is difficult to say what the problem is without knowing more about your project. In what way&amp;nbsp;is your code not working? Do you get errors when building? If so, which errors are you getting? Or is the problem when the application is running, that it either stops working or that the GPIO interrupt does not happen?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322558?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 03:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9e64be5-f869-47ac-b66e-78307f4b4e79</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your support.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I already defined in&amp;nbsp;&lt;span&gt;&lt;strong&gt;Preprocessor&lt;/strong&gt;&amp;nbsp;&lt;strong&gt;Definitions.&lt;br /&gt;&lt;br /&gt;Could you check the code that I posted above? Hope that You can find out issue.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Thanks&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322557?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 02:57:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40428d5e-bc9d-450f-b5ad-addb8e6bb21c</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;my application is config GPIO 10 as GPIO interrupt. I already defined&amp;nbsp;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS in Preprocessor Definitions as you refer.&lt;br /&gt;This is my code. Could you help me check it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;P/S; macro&amp;nbsp;FLOW_SS_PIN_INPUT is defined as GPIO 10&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{ 
    test_adc = true;
    flow_cnt ++;
    FLOW_DBG(TAG, &amp;quot;cnt = %d\r\n&amp;quot;, flow_cnt);
}

void flow_sensor_init(void)
{
  ret_code_t err_code;
  
    if ((NRF_UICR-&amp;gt;NFCPINS &amp;amp; UICR_NFCPINS_PROTECT_Msk)== (UICR_NFCPINS_PROTECT_NFC &amp;lt;&amp;lt; UICR_NFCPINS_PROTECT_Pos))
    {
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        NRF_UICR-&amp;gt;NFCPINS &amp;amp;= ~UICR_NFCPINS_PROTECT_Msk;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
        NVIC_SystemReset();
    }

  //init gpioe
  err_code = nrf_drv_gpiote_init();
  APP_ERROR_CHECK(err_code);

  //init input
  nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
  in_config.pull = NRF_GPIO_PIN_PULLUP;

  err_code = nrf_drv_gpiote_in_init(FLOW_SS_PIN_INPUT, &amp;amp;in_config, in_pin_handler);
  APP_ERROR_CHECK(err_code);

  nrf_drv_gpiote_in_event_enable(FLOW_SS_PIN_INPUT, true);

}
&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322184?ContentTypeID=1</link><pubDate>Wed, 28 Jul 2021 09:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be3592fd-8e89-4d95-be1b-bea6a1a81477</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;How have you defined&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS?&lt;/p&gt;
&lt;p&gt;You should add this to the preprocessor definitions in SEGGER Embedded Studio. You can do so by doing the following: Go to&amp;nbsp;&lt;strong&gt;&lt;span&gt;Project&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;Edit Options&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;Preprocessor&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;Preprocessor&lt;/strong&gt; &lt;strong&gt;Definitions&lt;/strong&gt;&lt;/span&gt; and add&amp;nbsp;CONFIG_NFCT_PINS_AS_GPIOS there.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322096?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 15:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cbac45d-fd81-4825-bad0-24f0ceb1e8a0</guid><dc:creator>John Nguyen</dc:creator><description>&lt;p&gt;I mean when I defined&amp;nbsp;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS, my code still doesn&amp;#39;t work.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can I put this code in main.c, before init gpio, right?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;John N&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use GPIO 09, GPIO 10 nrf52840 as GPIO interrupt</title><link>https://devzone.nordicsemi.com/thread/322021?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 11:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d8cd040-94de-4799-90e9-db9d49ee683a</guid><dc:creator>Andre</dc:creator><description>&lt;p&gt;Why can&amp;#39;t you define &lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/span&gt;?&lt;/p&gt;
&lt;p&gt;Nevertheless, if for some reason you cannot define &lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/span&gt; you can run the code it would trigger by yourself&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	// Making sure the NFC pins are set as GPIO
	if ((NRF_UICR-&amp;gt;NFCPINS &amp;amp; UICR_NFCPINS_PROTECT_Msk)
			== (UICR_NFCPINS_PROTECT_NFC &amp;lt;&amp;lt; UICR_NFCPINS_PROTECT_Pos)) {
		NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
		while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy) {
		}
		NRF_UICR-&amp;gt;NFCPINS &amp;amp;= ~UICR_NFCPINS_PROTECT_Msk;
		while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy) {
		}
		NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
		while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy) {
		}
		NVIC_SystemReset();
	}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>