<?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 interrupt count</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19801/gpiote-interrupt-count</link><description>Hi 
 I am using nRF51822 (pca10001).I am unable to discover my device. I used the ble_app_template_s130_pca10028 as my base and added the code for gpiote handler as following. 
 static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Feb 2017 11:58:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19801/gpiote-interrupt-count" /><item><title>RE: GPIOTE interrupt count</title><link>https://devzone.nordicsemi.com/thread/77007?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 11:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98cc4db0-0d9d-4645-96ee-2fa066883ad1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What do you mean by you are not able to discover your device? You are not able to scan it with a central device? Was it working with the unmodifed ble_app_template? Have you tried to used the debugger to see what is happening? I also recommend checking returned the error codes with APP_ERROR_CHECK(err_code) to see if the operations are actually accepted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupt count</title><link>https://devzone.nordicsemi.com/thread/77011?ContentTypeID=1</link><pubDate>Sun, 19 Feb 2017 05:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29db9dd6-63d6-4be9-aff9-81a848605696</guid><dc:creator>karthik</dc:creator><description>&lt;p&gt;Hi Roger Clark. Thank you so much. Since I am new to BLE I would like to ask you some help for my project. I am trying to capture the changes in PIN28 and transfer the count(number of changes) to another nRF51822, with which I communicate with my android phone. I&amp;#39;ve identified the softdevices to be used from this link &lt;a href="https://devzone.nordicsemi.com/question/44691/connect-two-nrf51822-possible/"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I would be happy if you could help me with program flow (if possible some important code snippets since i have my project deadline on 1st march)&lt;/p&gt;
&lt;p&gt;Thanks a lot in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupt count</title><link>https://devzone.nordicsemi.com/thread/77010?ContentTypeID=1</link><pubDate>Sun, 19 Feb 2017 00:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:925231f4-e189-4918-962d-75893ff1b475</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;If you want to check more quickly, you may want to use&lt;/p&gt;
&lt;p&gt;NRF_GPIO-&amp;gt;IN&lt;/p&gt;
&lt;p&gt;which returns the whole of the GPIO at the same time and you just need to mask the bit you are testing for&lt;/p&gt;
&lt;p&gt;Calling nrf_drv_gpiote_in_is_set is OK, but will take longer to run (which is especially important in an ISR)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupt count</title><link>https://devzone.nordicsemi.com/thread/77009?ContentTypeID=1</link><pubDate>Sat, 18 Feb 2017 05:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe10e5d1-5971-4118-a0c7-8aebec213b48</guid><dc:creator>karthik</dc:creator><description>&lt;p&gt;Thank u Johannes. I ll try this out :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE interrupt count</title><link>https://devzone.nordicsemi.com/thread/77008?ContentTypeID=1</link><pubDate>Sat, 18 Feb 2017 04:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:099a6606-9007-42ae-9330-43432062fef6</guid><dc:creator>Johannes Lorenz</dc:creator><description>&lt;p&gt;Hi,
on my nRF51822 I use this configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false); 
in_config.pull = NRF_GPIO_PIN_NOPULL;
in_config. sense = NRF_GPIO_PIN_SENSE_LOW;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then in gpiote_event_handler I catch the &lt;em&gt;action&lt;/em&gt; NRF_GPIOTE_POLARITY_TOGGLE and check with nrf_drv_gpiote_in_is_set(pin) whether we have a low to high or high to low pin event.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (action == NRF_GPIOTE_POLARITY_TOGGLE) {
		if (!nrf_drv_gpiote_in_is_set(pin)) {
			// high to low pin event
		} else {
			// low to high pin event
		}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I avoid using &lt;em&gt;GPIOTE_CONFIG_IN_SENSE_LOTOHI(true)&lt;/em&gt; . Because of a bug in this NRF51822 revision, individual pin interrupts (true) uses HF and 1mA current!&lt;/p&gt;
&lt;p&gt;HTH Johannes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>