<?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>Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13549/start-and-stop-rtc-with-port-events-on-a-single-pin</link><description>Hi, i&amp;#39;m wondering if it&amp;#39;s possible to make a GPIO pin trigger different tasks when it is externally driven from low to high, and high to low. 
 I&amp;#39;m trying to stop an RTC timer when a pin goes high and start it again when it goes low, using PPI.
Do i</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 May 2016 10:34:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13549/start-and-stop-rtc-with-port-events-on-a-single-pin" /><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51705?ContentTypeID=1</link><pubDate>Tue, 03 May 2016 10:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7c8e91-f47e-4744-91cd-d99f48e890ac</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;The GPIOTE driver toggles sensing mode (hi-lo) each time before the handler is called. By utilizing the same functions as the driver i finally got it to work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrf_gpio_pin_sense_t sense = nrf_gpio_pin_sense_get(ADXL362_INT_PIN);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if(sense == NRF_GPIO_PIN_SENSE_HIGH) 	
{ 		
NRF_RTC0-&amp;gt;TASKS_STOP = 1; 	
} 	
else if (sense == NRF_GPIO_PIN_SENSE_LOW) 	
{ 		
NRF_RTC0-&amp;gt;TASKS_START = 1; 	
}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thanks for all the help anyways :)&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51703?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 14:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d0bce3-7d06-4a1a-8cff-6ce735372f31</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I&amp;#39;ve stepped trough the event_enable function, but i can&amp;#39;t find any trace of any clock requisition :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51702?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 14:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46aea46f-ec67-477a-b4de-95645b880e8d</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;It&amp;#39;s stated the same in nRF52 SDK v0.9.2
I&amp;#39;m gonna dig trough the driver and see which clock get requested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51693?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 14:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8908c159-760e-4e6b-a9ca-0edb27a84dc3</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I&amp;#39;d test that myself and see if it&amp;#39;s actually true. That SDK is common to the nRF51 and nRF52 and it&amp;#39;s said that ever since that driver made an appearance in the SDK. I would have expected that long-running PAN to have been fixed in the nRF52.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51701?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 14:00:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:712aee9c-096d-42eb-9afd-74b5ad4dbd74</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;From nRF5SDK/hardware drivers/gpiote/driver configuration, section &lt;strong&gt;Controlling input pins&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;When an IN_EVENT is enabled, it requests the high frequency clock. Therefore, this method is not suitable for scenarios where the system sleeps for a long period of time, expecting to be waken up by a pin level change.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Which is my use case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51700?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:54:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90f3a385-5351-4596-ae5c-00f7f6f5b67a</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Spec says that having one or more GPIOTE active channels in input mode draws .5uA. I don&amp;#39;t see a block resource chart for the nRF52 but the GPIOTE requiring HFCLK in IN mode was always listed as a product anomaly for the nRF51 series, I don&amp;#39;t see any similar PAN for the nRF52, so are you sure HFCLK is required?  The 0.5uA would indicate that it&amp;#39;s not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51699?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91d9be06-66ae-4fd5-ae15-9309e6d6bb30</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;What is your application? Probably you are misleading us. LOL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51698?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:40:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84212f3b-57c2-46bf-bc27-90071f5dc1b2</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I got strict power requirements, therfore I can&amp;#39;t have a high frequency clock running to be able to detect EVENTS_IN.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51697?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:27:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ccc7e2b-724d-46cc-8d2e-53753577fbd6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Why are you talking about the PORT event? It&amp;#39;s not the PORT event you need, it&amp;#39;s the individual GPIOTE events if you want to detect low-&amp;gt;high or high-&amp;gt;low events. Assign one such GPIOTE to one pin and one to another pin, then drive both pins from the same source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51696?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:06:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d487c818-06e0-4f03-a1ef-22ce53d755ce</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Also please post your code here with your problem.
So that we can directly help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51695?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 13:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1248bc9-4773-499c-baa9-32bb2b6755fa</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;So are you saying all the I/O&amp;#39;s on your board have been assigned?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51694?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 12:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce145aa9-a1bd-45ed-ac62-c71ca0137a7c</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I cannot allocate another GPIOTE channel to a  second pin that also uses the PORT event, unless i start hacking away at the driver.
So I&amp;#39;m back to square one...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51692?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 09:40:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0da644df-c0b7-4200-b125-b2f1190f565e</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I&amp;#39;ll try the dual GPIOs, thanks! :D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51704?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 01:20:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7e73a29-2750-4241-bbdc-afa70eb94e3a</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Yep, I almost did a layout change to tie two I/O&amp;#39;s together.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51691?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 00:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c9a40b4-67a2-410e-85a7-36fa7bdab3ef</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You technically can&amp;#39;t do this the obvious way, by assigning two GPIOTE channels, one up, one down, to the same pin .. from the manual&lt;/p&gt;
&lt;p&gt;&amp;quot;Only one GPIOTE channel can be assigned to one physical pin. Failing to do so may result in unpredictable behavior.&amp;quot;&lt;/p&gt;
&lt;p&gt;In the nrf51 series this limitation only actually applied to output to the pin, which makes sense, and although never documented as safe, you could attach two input GPIOTE channels to the same pin and it worked.&lt;/p&gt;
&lt;p&gt;So you could try that - see if it works or not, but be aware you&amp;#39;re not really following the spec if you do.&lt;/p&gt;
&lt;p&gt;Another option would be to use one toggle GPIOTE, then two groups of 3 PPIs each, one group containing a PPI to start the timer, one a PPI to stop it and the other two PPIs to enable/disable the other group each time. In that way you flip-flop between two states automatically.&lt;/p&gt;
&lt;p&gt;The best way to do this however is to attach your input signal to two GPIOs and configure one GPIOTE each on them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51690?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2016 16:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d6270f2-faab-4ea4-90df-5f2ac9ec65cf</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to halt the execution of code which is periodically called with the RTC, using an external interrupt.&lt;/p&gt;
&lt;p&gt;Do i use the placeholder pin when i run nrf_drv_gpiote_in_event_addr_get(placeholder) when assigning EEP and TEP to a ppi channel?&lt;/p&gt;
&lt;p&gt;exp:
APP_ERROR_CHECK(nrf_drv_ppi_channel_assign(ppi_channel_rtc_start,
nrf_drv_gpiote_in_event_addr_get(ADXL362_INT_PIN),
nrf_drv_rtc_task_address_get(&amp;amp;rtc, NRF_RTC_TASK_STOP)));&lt;/p&gt;
&lt;p&gt;edit:
It seems that nrf_gpiote_event_configure is only valid when GPIOTE is in high accuracy mode (using hfclk), otherwise it is using:
m_cb.port_handlers_pins[channel-NUMBER_OF_GPIO_TE] |= (p_config-&amp;gt;sense)&amp;lt;&amp;lt; SENSE_FIELD_POS;&lt;/p&gt;
&lt;p&gt;The control block is locked static in the driver, so i don&amp;#39;t have access to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51689?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2016 16:32:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f302039b-5e54-4d8a-b57b-bf5c2d645d8a</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Probably in the next SDK release Nordic can remove this limitation? :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51688?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2016 16:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:527d1f68-c5bc-4f15-852d-2fde241e9a5f</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Sorry, I didn&amp;#39;t see nRF52 in your message. I haven&amp;#39;t used 52 a lot.
But I think it is the same concept:
Are you having problem using single pin for two tasks?
I solved this issue by some tricks in nRF51 SDK:
You need to use a &amp;quot;unused/fake&amp;quot; pin as a channel placeholder to hold the other channel for the &amp;quot;real&amp;quot; pin. and then change the &amp;quot;fake&amp;quot; pin back to the &amp;quot;real&amp;quot; pin by using nrf_gpiote_event_configure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start and stop RTC with PORT events on a single pin</title><link>https://devzone.nordicsemi.com/thread/51687?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2016 16:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7c1e2d0-f1fe-4fef-b465-60a2893dfc39</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Yes, you can do this no problem. and you need to use GPIOTE.
I guess you are capturing pulse width using RTC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>