<?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>NRF52832 using GPIOTE and PPI to measure both low&amp;#39;s and high&amp;#39;s of a pulse with SD enabled.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35756/nrf52832-using-gpiote-and-ppi-to-measure-both-low-s-and-high-s-of-a-pulse-with-sd-enabled</link><description>Hi all, we&amp;#39;re using code from this forum to enable GPIOTE and PPI to measure the low between the arrows to indicate a &amp;quot;start of transmission&amp;quot; and then switch to measuring the highs after that. But so far, I can only measure one or the other (high or low</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jun 2018 13:58:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35756/nrf52832-using-gpiote-and-ppi-to-measure-both-low-s-and-high-s-of-a-pulse-with-sd-enabled" /><item><title>RE: NRF52832 using GPIOTE and PPI to measure both low's and high's of a pulse with SD enabled.</title><link>https://devzone.nordicsemi.com/thread/137928?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 13:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0f26fd1-f61d-4628-825f-3a76f43310bc</guid><dc:creator>AxisRobotics</dc:creator><description>&lt;p&gt;Thanks Edvin, that makes sense!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 using GPIOTE and PPI to measure both low's and high's of a pulse with SD enabled.</title><link>https://devzone.nordicsemi.com/thread/137729?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 15:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aec28749-11e8-4c15-a468-c9c124c24c34</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You must re-configure the PPI channels in order to switch from reading the lows and reading the highs.&lt;/p&gt;
&lt;p&gt;Alternatively, you can try to not stop the TIMER on NRF_PPI-&amp;gt;FORK[1].TEP, but instead use another CC register to capture the time between LOTOHI and HITOLO. Then you must read out the CC value, and compare it to the last time, in order to calculate the difference, but it should be possible.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In pseudo code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_TIMER1-&amp;gt;TASKS_START = 1; // call this from the application layer)

PPI-&amp;gt;CH[0].EEP = GPIOTE-&amp;gt;EVENTS_IN[0];
PPI-&amp;gt;CH[0].TEP = TIMER-&amp;gt;TASKS_CAPTURE[0];

PPI-&amp;gt;CH[1].EEP = GPIOTE-&amp;gt;EVENTS_IN[1];
PPI-&amp;gt;CH[0].TEP = TIMER-&amp;gt;TASKS_CAPTURE[1];

NRF_PPI-&amp;gt;CHENSET (CH0_Msk | CH1_Msk);

NVIC_EnableIRQ(GPIOTE_IRQn);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then read the CC registers in the application and compare it to the previous interrupt to figure out how many ticks that has passed since last interrupt. This way you can get the interrupts from both HITOLO and LOTOHI, and you decide which interrupts you want to deal with in the application.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>