<?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>SPIM STOP task isn&amp;#39;t getting triggered by PPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68375/spim-stop-task-isn-t-getting-triggered-by-ppi</link><description>Hey all, I&amp;#39;m new here. So far things have been going pretty well, I am just having an issue with PPI that I can&amp;#39;t quite figure out, but I think I&amp;#39;m close. I currently have an nRF52840 DK hooked up to a 6 axis sensor with a FIFO buffer. I get the number</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Nov 2020 23:27:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68375/spim-stop-task-isn-t-getting-triggered-by-ppi" /><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280216?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 23:27:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c46fdf9e-817f-4f63-9c39-6ac5fdc19d84</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;Ahhhhh, I saw that 4 CC register thing, but somehow it didn&amp;#39;t sink in at the time.&amp;nbsp; I already switched to COMPARE0, but it was still bothering me&amp;nbsp; Thanks for that!&lt;/p&gt;
&lt;p&gt;As for the shorts, I think I posted an &amp;quot;answer&amp;quot; about the same time you posted this, but yes, that was the issue.&amp;nbsp; I didn&amp;#39;t realize that the SHORTS can&amp;#39;t be turned off in hardware, so I came up with a solution just using PPI and channel groups (since those have enable/disable tasks that can be triggered).&lt;/p&gt;
&lt;p&gt;Thanks for all of your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280204?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 20:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d928391-4800-4af3-8b4f-6ba62220488b</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;Just had a moment of inspiration to solve the SPIM SHORTS problem.&amp;nbsp; Instead of using SHORTS, I just made a new PPI channel from SPIM END Event to SPIM START Task, then added is to PPI CHG[0].&amp;nbsp; Then I added a FORK to PPI[2] to trigger a PPI CHG[0].DIS Task, thus disconnecting the short from SPIM END to SPIM START.&lt;/p&gt;
&lt;p&gt;Still curious about COMPARE5 though.&amp;nbsp; If I don&amp;#39;t hear back by tomorrow on that I will close this out since I answered my own question and open a new ticket for COMPARE5.&lt;/p&gt;
&lt;p&gt;EDIT: Per Daniel Chisholm, the datasheet indicates that there is no COMPARE5 for TIMER0-2, so that answers that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280201?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 20:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf8acecd-3d9d-459c-bdaf-9e368fcc9dbc</guid><dc:creator>Daniel Chisholm</dc:creator><description>&lt;p&gt;Just had a look at the nrf52840 Product Specification and section 6.5.30 &amp;quot;Registers&amp;quot; indicates that TIMER0-TIMER2 have 4 CC registers, and TIMER3-TIMER4 have 6 CC registers.&amp;nbsp; So COMPARE5 doesn&amp;#39;t exist for TIMER1.&amp;nbsp; Why not try COMPARE3 and see if that works, or try COPMARE5 with TIMER3 or TIMER4? (BTW ii&amp;nbsp;seems remarkable to me that CH[2].EEP reads back &amp;quot;0&amp;quot; when you wrote 0x40009154 to it (where TIMER1.EVENTS_COMPARE[5] would be, if it were to exist)..... I can&amp;#39;t begin to think how that might be implemented in the silicon?)&lt;/p&gt;
&lt;p&gt;BTW2, I noticed in your debugger output that SPIM3.SHORTS = 0x0020000, which means &amp;quot;Shortcut between event END and task START&amp;quot;.... so maybe in fact your COMPARE0 really is stopping SPIM3, but as soon as it ends then this shortcut immediately restarts it? (EVENTS_STARTED also shows &amp;quot;1&amp;quot;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280200?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 19:48:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6222076-2052-4c5a-aa36-b740439520e3</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;So I think I finally grok the problem here.&amp;nbsp; Kicking off the STOP take for SPIM does nothing if SHORTS are still set.&amp;nbsp; Somehow you have to disable SHORTS, which I&amp;#39;m guessing requires software intervention?&amp;nbsp; I disconnect it first thing in my TIMER1 COMPARE0 handler, but I still get a two byte overrun since SPIM is still running in the background.&amp;nbsp; I can just discard this data for my purposes here, but is there a better way?&amp;nbsp; It feels like there should be a DISCONNECT SHORTS task in SPIM, or some other equivalent but I&amp;#39;m not finding it.&lt;/p&gt;
&lt;p&gt;Still would like to know why COMPARE5 doesn&amp;#39;t work though...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280155?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 14:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6519602f-546b-4866-8703-8cb62060b8ea</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;OK, so after a little testing, I am very confused.&amp;nbsp; Per Daniel Chisholm, I fixed my COMPARE0 bug, but now I notice that cannot set PPI to the COMPARE5 event.&amp;nbsp; Is there some reason that this event cannot be used?&lt;/p&gt;
&lt;p&gt;Here is what happens if I use COMPARE0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* PPI Configuration - NOTE that we DO NOT enable PPI here, but in the SPIM FIFO read
     * Configure PPI channel 0 to increment TIMER1 counter on SPIM END event.
     */
    NRF_PPI-&amp;gt;CH[0].EEP  = (uint32_t)((uint32_t)NRF_SPIM3_BASE   + (uint32_t)NRF_SPIM_EVENT_END);  // EVENTS_END
    NRF_PPI-&amp;gt;CH[0].TEP  = (uint32_t)((uint32_t)NRF_TIMER1_BASE  + (uint32_t)NRF_TIMER_TASK_COUNT);  // TASKS_COUNT

    /* Configure PPI channel 2 to initiate a SPIM STOP task on TIMER1 COMPARE event.
     */
    NRF_PPI-&amp;gt;CH[2].EEP  = (uint32_t)0x40009140UL; // Address for COMPARE0
    NRF_PPI-&amp;gt;CH[2].TEP  = (uint32_t)((uint32_t)NRF_SPIM3_BASE   + (uint32_t)NRF_SPIM_TASK_STOP);  // TASKS_STOP&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-2020_2D00_11_2D00_16-095342.png" /&gt;&lt;/p&gt;
&lt;p&gt;But with COMPARE5:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* PPI Configuration - NOTE that we DO NOT enable PPI here, but in the SPIM FIFO read
     * Configure PPI channel 0 to increment TIMER1 counter on SPIM END event.
     */
    NRF_PPI-&amp;gt;CH[0].EEP  = (uint32_t)((uint32_t)NRF_SPIM3_BASE   + (uint32_t)NRF_SPIM_EVENT_END);  // EVENTS_END
    NRF_PPI-&amp;gt;CH[0].TEP  = (uint32_t)((uint32_t)NRF_TIMER1_BASE  + (uint32_t)NRF_TIMER_TASK_COUNT);  // TASKS_COUNT

    /* Configure PPI channel 2 to initiate a SPIM STOP task on TIMER1 COMPARE event.
     */
    NRF_PPI-&amp;gt;CH[2].EEP  = (uint32_t)0x40009154UL; // Address for COMPARE5
    NRF_PPI-&amp;gt;CH[2].TEP  = (uint32_t)((uint32_t)NRF_SPIM3_BASE   + (uint32_t)NRF_SPIM_TASK_STOP);  // TASKS_STOP&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-2020_2D00_11_2D00_16-095539.png" /&gt;&lt;/p&gt;
&lt;p&gt;I also notice that the app does a full rebuild when I make this change, indicating that something bigger has changed with the app as a whole.&amp;nbsp; So... what&amp;#39;s the deal COMPARE5?&lt;/p&gt;
&lt;p&gt;EDIT: I should also add that even after changing back to COMPARE0, SPIM3 is still not stopping even though the STOP event has occurred:&lt;/p&gt;
&lt;p&gt;I break in the TIMER1 compare handler (so COMPARE0 has happened, and therefore PPI CH[2] should have stopped SPIM3):&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-2020_2D00_11_2D00_16-101159.png" /&gt;&lt;/p&gt;
&lt;p&gt;and here are the SPIM3 registers:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-2020_2D00_11_2D00_16-100717.png" /&gt;&lt;/p&gt;
&lt;p&gt;Even if I uncomment the TASKS_STOP trigger at the top of the handler, it still doesn&amp;#39;t stop. The only way it stops is if I disable SPIM3 in the handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280134?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 14:23:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a04acad3-896f-4438-af5d-1e6d1ee8f873</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;Hmm I tried this and just noticed something weird, PPI CH[2].EEP never gets set, it just stays =0x00.&amp;nbsp; Maybe there is something that blocks using PPI CH[2]?&amp;nbsp; It is the only thing I can see that isn&amp;#39;t set correctly when I step through the debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280124?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 13:56:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5b8b026-6c71-43df-b3d9-b2d1619deb14</guid><dc:creator>kv1980</dc:creator><description>&lt;p&gt;Ah yes I changed from Compare0 to Compare5 but never updated the PPI address (earlier when something else want working I got to thinking that Compare0 might be reserved by the SoftDevice like Timer0 is, I don&amp;#39;t think that&amp;#39;s the case though).&amp;nbsp; I&amp;#39;ll have to give this a try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM STOP task isn't getting triggered by PPI</title><link>https://devzone.nordicsemi.com/thread/280071?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2020 10:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8ee2b29-04d6-43fa-9e5a-5c2718540fb9</guid><dc:creator>Daniel Chisholm</dc:creator><description>&lt;p&gt;In line 35 you are connecting to event COMPARE0, however in the code you provide nothing us setting CC[0] to 6; by default it will be 0, i.e. effectively 65536.&amp;nbsp; And in line 24 you setting CC[5] to 0xffff but it (COMPARE5) seems unused?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(BTW a lot of sympathy for your rant.&amp;nbsp; And I think timer SHORTS can be accessed through the SDK function &amp;quot;...extended_compare...&amp;quot;, which is not an immediately intuitive naming choice!)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>