<?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>2 x NRF_PPI with FORK does not have the same behavior as 4 x NRF_PPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101988/2-x-nrf_ppi-with-fork-does-not-have-the-same-behavior-as-4-x-nrf_ppi</link><description>I am porting a piece of code from NRF51 -&amp;gt; NRF52805. In a part of the code there is a requirement for 4 PPI channels. I wanted to optimize this to use 2 channels, making use of the FORT endpoints available on the NRF52 series. The initial configuration</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Jul 2023 14:20:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101988/2-x-nrf_ppi-with-fork-does-not-have-the-same-behavior-as-4-x-nrf_ppi" /><item><title>RE: 2 x NRF_PPI with FORK does not have the same behavior as 4 x NRF_PPI</title><link>https://devzone.nordicsemi.com/thread/437058?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 14:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4149d7dd-8d04-4823-a487-7fe9c39851d9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I see (I believe).&lt;/p&gt;
&lt;p&gt;I also believe it is correct that you may experience a 0 in one of the CC[n], if you capture at the same event that you are resetting.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not sure exactly how you are loading the new values, but perhaps it is not important.&lt;/p&gt;
&lt;p&gt;Since you are manually resetting the timer using PPI/fork, can you try to remove the clear short? And if that doesn&amp;#39;t work, remove the clear ppi task, so that you only use one at the time?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Other than that, I can&amp;#39;t say that I am a fan of clearing the timer at the same time that you are capturing it. Is there some way you can avoid it?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have no idea of what frequencies you are using (if this triggers once per second, or 1000 times per second). Is there a chance to involve the CPU? If so, you wouldn&amp;#39;t need to reset the timer at all, but you could just add the old CC value to the new one?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 x NRF_PPI with FORK does not have the same behavior as 4 x NRF_PPI</title><link>https://devzone.nordicsemi.com/thread/437044?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 13:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b347715-e543-468a-bbfb-9e6c37d0bc48</guid><dc:creator>Marne</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;What I am trying to do is to set a value of my timer in sync with the timer and an external event.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The external event is triggering the timer periodically. The timer will run until CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;], modifying GPIOTEs at CC[&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;] and CC[&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;]. Due to the real time requirements of this system I cannot &amp;quot;randomly&amp;quot; change any of CC[&lt;/span&gt;&lt;span&gt;0-2&lt;/span&gt;&lt;span&gt;]. Instead I use CC[&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;] to transfer the values at the right time. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;In order to do this I load the new value for (for instance) CC[&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;] in CC[&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;] and use a PPI to link EVENT_COMPARE[&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;] -&amp;gt; TASKS_CAPTURE[&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;]. This allows me to only update my CCs at a very controlled time, without using the CPU directly.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;In the case that is failing I am reducing the value of CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;], the maximum value of the timer. So CC[&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;] &amp;lt; CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;]. The timer triggers at CC[&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;] first, which loads the new value to CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;] and resets the timer for the next period. I havent been able to determine if it is during this period, or the next that it fails. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;From what I can see with my oscilloscope the GPIOTE task which is supposed to Toggle the pin fails to execute. This task is triggered at both CC[&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;] and CC[&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;], both of which are separated by at least 2 timer ticks, and less than CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;] by at least 2. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;It looks like everything recovers for the susequent period, I get one incorrect period. I believe this would not happen if I loaded a 0 to CC[&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;]. &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 x NRF_PPI with FORK does not have the same behavior as 4 x NRF_PPI</title><link>https://devzone.nordicsemi.com/thread/437040?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 13:22:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e56db3d8-aa7a-419e-bb81-b1d6d344bbfb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you describe in a bit more detail in what way it doesn&amp;#39;t work? Do you see a lot of 0x00000000 in your capture registers?&lt;/p&gt;
&lt;p&gt;When doing capture and clear basically at the same time, it is a bit random which one will execute first. Perhaps the two different chips behaved a bit differently doing this.&lt;/p&gt;
&lt;p&gt;Do you strictly need to capture the timer when you know that it triggered from a compare?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regardless, can you describe what the intended behavior is, and what you are actually seeing?&lt;/p&gt;
&lt;p&gt;&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>