<?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>low power pulsewidth measurement: PPI &amp;amp; lfclk &amp;amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10580/low-power-pulsewidth-measurement-ppi-lfclk-s210---some-guidance-needed</link><description>Dear all, 
 I need to measure a pulse width on a GPIO pin which is in between 100mseconds and 7.2 seconds long without the use of &amp;quot;regular&amp;quot; timers due to low power requirements.
I am pretty sure this can be done with PPI and the 32.768 kHz lfclock </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Dec 2015 15:40:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10580/low-power-pulsewidth-measurement-ppi-lfclk-s210---some-guidance-needed" /><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39385?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 15:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da749d4c-1495-4306-b7de-dec960e7ce22</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Ole, thanks for the reply. In the meantime I removed the entire BSP stuff, so now it &lt;em&gt;should&lt;/em&gt; also work with the nrf_drv_gpiote, but for now I leave it as it is - with direct register access.
This is a nice example how too may layers of #defines and macros can lead to code that no one can understand...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39384?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 15:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b85df172-7817-48cb-a9ba-62da1fea0724</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I am glad you found the issue, I did not know the default interrupt priority was 0 and rather thought it was 3 (APP_PRIORITY_LOW), now I learned something :).&lt;/p&gt;
&lt;p&gt;Regarding the nrf_drv_gpiote failing, this is fixed with changing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In nrf_drv_config.h to a higher number (the bsp module takes 4 so none was left). I am sorry this took so long, but the guy who could help me was sick. Since it is not well documented that this macro have to be changed I will make an internal case on this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39390?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 15:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:893bf963-8ec8-4fc1-bb72-5da4a3a4319c</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Jepp, RK , that&amp;#39;s it. I set the interrupt priority to &amp;quot;1&amp;quot; ( no, no 37-letter-define used ) and it works. Thanks a lot !
So, maybe the &lt;code&gt;nrf_drv_gpiote_in_init&lt;/code&gt; I originally wanted to use also defaults to interrupt priority 0 and thus failed ?
Again, thanks to all for helping me out. Over time, the number and stupid-ness of my questions will degrade :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39389?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 15:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccdef15c-8826-454e-be14-40be131684be</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t matter if ap_twi uses it - not that it could, if it did you&amp;#39;d have multiple GPIOTE_IRQHander() functions and your code wouldn&amp;#39;t link. All that unavailable error code means is that the interrupt is unavailable because the softdevice uses it, and since we know it doesn&amp;#39;t, it must be the other one.&lt;/p&gt;
&lt;p&gt;Since you say you don&amp;#39;t set the priority - that&amp;#39;s your problem - default 0, softdevice doesn&amp;#39;t like that. Set it to APP_PRIORITY_HI or LO or whatever the constants are. There&amp;#39;s an sd_* function for that too, or just call the NVIC_* one&lt;/p&gt;
&lt;p&gt;I wonder why Keil eats error codes, don&amp;#39;t use it myself. Often feel like using Keil must be like ploughing a field with a horse, possible, but really hard work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39388?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 15:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f763eb5-8e5a-4e54-9cc8-08f593a56061</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;RK, thanks for the comment. 1) I do not know which of the two errors is returned. 2) I do not know if GPIOTE is an available interrupt. It is by the softdevice documentation, but maybe app_twi uses it ? 3) No, I did not set the interrupt priority, at least not that I know. I&amp;#39;ll try to find out how to set the priority and report back here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39387?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 15:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4ad1d7d-574c-4c8c-96d3-c5edf3af5ae3</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;So if the two errors are &amp;#39;interrupt not available&amp;#39; and &amp;#39;priority not allowed&amp;#39;, since you know GPIOTE is an available interrupt, it must be an invalid priority. Did you set the priority of the GPIOTE interrupt (if it&amp;#39;s in the rest of the answer somewhere I apologise, I looked but didn&amp;#39;t find it). If you didn&amp;#39;t set it, it&amp;#39;s by default 0 which isn&amp;#39;t allowed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39386?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 13:51:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0940a21a-fdd3-47e5-ae80-f5c659bd7da2</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Ole, the SoftDevice IS enabled and works. I do get ANT+ messages &amp;quot;on air&amp;quot;. Just, the GPIO ISR never fires and the reason is that &lt;code&gt;sd_nvic_EnableIRQ&lt;/code&gt; does return an error ( I am still not able to get the return values as the debugger insists that the variable assigned to it ( usually err_code ) is &amp;quot;not in scope&amp;quot;.
So we are back to the original where &lt;code&gt;nrf_drv_gpiote_in_init&lt;/code&gt; also returned an error.
If you could get me some advice on how to get the returned error code, we likely could track it down better. I use Keil V5.17 and your SDK version 10 (not the Keil packs) and the &lt;code&gt;ant_bpwr_tx_wheel_torque_button_s210&lt;/code&gt; example code.&lt;/p&gt;
&lt;p&gt;Aaaah, so you say I need to enable the softdevice FIRST and THEN call &lt;code&gt;sd_nvic_EnableIRQ()&lt;/code&gt; , correct ?
OK, up to now I set up the softdevice last in my main().&lt;/p&gt;
&lt;p&gt;Nope, makes no difference. &lt;code&gt;APP_ERROR_CHECK&lt;/code&gt; does never return if it checks the return value of &lt;code&gt;sd_nvic_EnableIRQ()&lt;/code&gt; , no matter if I call &lt;code&gt;sd_nvic_EnableIRQ()&lt;/code&gt; before or after softdevice setup...&lt;/p&gt;
&lt;p&gt;according to the sofdevice documentation there is only two possible errors for sd_nvic_EnableIRQ: Interrupt not available or priority not allowed... I have the feeling &amp;quot;something else&amp;quot; is using this interrupt already.&lt;/p&gt;
&lt;p&gt;This may help tracking it down:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/debugger.png" alt="debugger info about GPIOTE" /&gt;&lt;/p&gt;
&lt;p&gt;GPIO20 ( which is what I used here ) looks good:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/GPIO_5F00_20.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39383?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 12:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55ce0201-aa07-41c3-817a-4908f448331b</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;EDIT: If the SoftDevice is enabled, use &lt;code&gt;sd_nvic_enableIRQ(GPIOTE_IRQn)&lt;/code&gt;. If the SoftDevice is not enabled, use &lt;code&gt;NVIC_EnableIRQ(GPIOTE_IRQn)&lt;/code&gt;. sd_nvic_enableIRQ(...) will return error code if SoftDevice is not enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39380?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 10:59:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c8068a0-c797-4b41-83ea-21e1d37546e9</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;I DO use a softdevice. You mentioned that 19 hours ago...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39379?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 10:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf15c75-243e-47c9-aed5-f62fa5065acf</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Well, now it COMPILES but the &lt;code&gt;sd_nvic_EnableIRQ(GPIOTE_IRQn);&lt;/code&gt;  crashes the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39382?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 10:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe882306-9bff-4c89-a913-9423ac0c67af</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You only need to use sd_nvic_enableIRQ(...) if you are using a SoftDevice. If you are not using SoftDevice, use NVIC_EnableIRQ(...) instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39381?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 09:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1299ff8-7de8-41ab-ab01-a8158c381209</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Oooh, Ole, now I really must admit that I was very, very stupid. Putting you register access code into a function magically :-) makes it compile..
If I ever meet you in person, I owe you several beers... Lots !&lt;/p&gt;
&lt;p&gt;The only thing remaining now is that sd_nvic_enableIRQ() is not known and I cannot find it anywhere with a &amp;quot;search project&amp;quot;. So, likely it is in some .h that I have not yet included..
Yepp, in &amp;quot;nrf_soc.h&amp;quot; , found it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39378?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 15:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed0f3189-861f-4b49-8de7-bfa8d483fefe</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The code I gave you does not depend on the SDK, this only depends on the register definitions defined in nrf.h (or more precisely nrf51.h) just like in AVR. I do not know what the compile error is, as I tested it before I posted it.&lt;/p&gt;
&lt;p&gt;I forgot that you where using SoftDevice, then you should use sd_nvic_enableIRQ(GPIOTE_IRQn) instead if the SoftDevice is enabled. This is because the SoftDevice blocks the access to this register (see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.pdf.sds/S210_SDS_v3.0.pdf"&gt;SD specification&lt;/a&gt; part 10.3).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39377?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 14:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c39fe72-0872-4e14-8e01-f2dbd926b30c</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I removed nrf_drv_&lt;code&gt;gpiote.c&lt;/code&gt; and as a consequence I also had to remove &lt;code&gt;bsp.c&lt;/code&gt;, &lt;code&gt;bsp_btn_ant.c&lt;/code&gt;, &lt;code&gt;app_button.c&lt;/code&gt; and to comment out a lot of other stuff. Then, I at least could compile and run without the nrf_drv_gpiote.(c/h).
NOTE: edited to remove wrong assumptions from my side which made this discussion confusing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39373?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 16:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07cd72cb-a468-43fc-ac19-3829a56c1110</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can use register access on most of the peripherals, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.130.sds.v1.0.0/sd_resource_reqs/hw_block_interrupt_vector.html?cp=2_7_2_0_10_2"&gt;here&lt;/a&gt; for which are restricted or blocked for s130 (for other SoftDevices see own specification on PDF).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39372?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 15:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfb7702d-517b-4e5c-93c6-be62b444bc42</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Ole, thanks. So far I got the impression that if you use a softdevice you should NOT use direct register access. Anyhow, I&amp;#39;ll try.
If I remove nrf_drv_gpiote.c, I will get 254E12 compiler errors from app_button, bsp, bsp_btn_ant and so on.
I&amp;#39;ll try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39371?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 15:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a0b6da2-2248-422e-a390-8fcc9e4f22da</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I will not get an answer before tomorrow. When it comes to gpiote, you may be better off using the registers and not the SDK. This code will setup a pin for SENSING and enable the PORT event interrupt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_GPIO-&amp;gt;PIN_CNF[BSP_BUTTON_0] =   (GPIO_PIN_CNF_DIR_Input &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos)
                                    |(GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos)
                                    |(GPIO_PIN_CNF_PULL_Pullup &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos)
                                    |(GPIO_PIN_CNF_SENSE_Low &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);

NRF_GPIOTE-&amp;gt;INTENSET = (GPIOTE_INTENSET_PORT_Enabled &amp;lt;&amp;lt; GPIOTE_INTENSET_PORT_Pos);

NVIC_EnableIRQ(GPIOTE_IRQn);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The interrupt code will be like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void GPIOTE_IRQHandler(void)
{
    if((NRF_GPIOTE-&amp;gt;EVENTS_PORT == 1) &amp;amp;&amp;amp;
        ((NRF_GPIOTE-&amp;gt;INTENSET &amp;amp; GPIOTE_INTENSET_PORT_Msk) != 0))
    {
        NRF_GPIOTE-&amp;gt;EVENTS_PORT = 0;
       //code to execute on PORT event goes here
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Be sure to remove the nrf_drv_gpiote.c file from your project or you will get multiple definitions of the IRQHandler. I suggest that you also read 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: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39370?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 15:06:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:986fc96d-1c75-4e51-a420-b16cb606feee</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;It does NOT work for me with high accuracy. Note: not the nrf_drv_gpiote_in_init crashes the application. The subsequent APP_ERROR_CHECK does. So far I was not able to find out what APP_ERROR_CHECK does. It points to a function ( via a macro pointing to a macro pointing to a function ... ) that to me seem just to copy some parameters to new variables with a m_ prefix and then go to an infinite loop ??
On the debugger screenshot below you can see that &amp;quot;err_code&amp;quot; is  &amp;quot;out of scope&amp;quot; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39369?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 14:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9047bd45-6f0d-4f5a-89f0-5ce29876f3a8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;It works when setting the accuracy to high, &lt;code&gt;GPIOTE_CONFIG_IN_SENSE_LOTOHI(true)&lt;/code&gt;, strange...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39368?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 14:55:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b21c8c-3059-4422-b3e8-4cd298dffb70</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I get the same error (&lt;code&gt;NRF_ERROR_NO_MEM&lt;/code&gt;) just trying to add gpiote in pin in the ble_app_template example. The problem is that it should work when setting accuracy to low (will use PORT event which have no restrictions other than number of pins used). I will talk with the developers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39367?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 14:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ed69b5d-0a18-45f2-8f35-6fbfb0ff3772</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I put in the &amp;quot;initialize only if not yet done&amp;quot; code with no change. The nrf_drv_gpiote_in_init fails.
It also fails if I assign a different pin ( I used Button_3 before and this likely is already taken by the BSP ?? ).
So, seems like there is no channel available. I try to un-assign a button from the example code to gain a channel back ? It&amp;#39;s not documented what the buttons do, anyway..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39366?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 13:16:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fa02708-c394-47b9-aedf-5b732d7ceed6</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Thats why the code i sent in the previous comment checks if it is initialized, and only inits it if not. It should have been called if you used app_button.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39363?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 12:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6c6ea68-ecee-493f-8256-41f3ed3d108a</guid><dc:creator>WolfgangEbersbach</dc:creator><description>&lt;p&gt;Well, that is exactly the point: I do not know if nrf_drv_gpiote_init was called SOMEWHERE. But likely it was, as the app_button seems to use it, right ?&lt;/p&gt;
&lt;p&gt;Anyhow, I&amp;#39;ll now try to make an outline about who initializes what to which state where. On paper.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39365?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 10:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50eb1907-e8ec-47c4-8e01-35d3639f14c4</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You have called nrf_drv_gpiote_init()? Do it like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(!nrf_drv_gpiote_is_init())
{
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power pulsewidth measurement: PPI &amp; lfclk &amp; S210 - some guidance needed</title><link>https://devzone.nordicsemi.com/thread/39364?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 10:28:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60683344-3a33-47fd-888f-74b9aab0a07d</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;&lt;code&gt;nrf_drv_gpiote_in_init(...)&lt;/code&gt; returns error? It looks like this happens either if the pin is in use by the GPIOTE already - &lt;code&gt;NRF_ERROR_INVALID_STATE&lt;/code&gt;, or if there are no available channels (limited to 4) - &lt;code&gt;NRF_ERROR_NO_MEM&lt;/code&gt;. Could you check the return value?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>