<?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>PPI will not stop SPIM, however EGU does.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84473/ppi-will-not-stop-spim-however-egu-does</link><description>Hi! Im doing a SPI transaction using EGU and PPI. Software triggers the EGU, and PPI_CHANNEL_1 uses this event to start the SPIM transaction and set the CS pin low. PPI_CHANNEL_2 uses the SPIM_EVENTS_END to set the CS pin high again, and also trigger</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 12 Feb 2022 20:59:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84473/ppi-will-not-stop-spim-however-egu-does" /><item><title>RE: PPI will not stop SPIM, however EGU does.</title><link>https://devzone.nordicsemi.com/thread/352771?ContentTypeID=1</link><pubDate>Sat, 12 Feb 2022 20:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19de5703-024e-4e24-84b3-1d4da4b44cfb</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Errata 58 for the SPIM when Rx MAXCNT is set to 1 might be worth looking at:&amp;nbsp;&lt;em&gt;An additional byte is clocked out when RXD.MAXCNT = 1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_Rev2%2FERR%2FnRF52832%2FRev2%2Flatest%2Fanomaly_832_58.html"&gt;anomaly_832_58&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI will not stop SPIM, however EGU does.</title><link>https://devzone.nordicsemi.com/thread/352768?ContentTypeID=1</link><pubDate>Sat, 12 Feb 2022 16:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c21bd15-b37a-47e0-9c22-65f7a1d4181f</guid><dc:creator>JosteinBrovold</dc:creator><description>&lt;p&gt;After more debugging, I figured out that the increased current draw comes from having the RX and TX MAXCNT to 1. Only sending one byte seems to keep the SPI running, resulting in a current draw of about 500 uA.&lt;br /&gt;&lt;br /&gt;Increasing RX MAXCNT to 2, allowing it to receive 2 bytes, seems to stop the SPI transaction afterwards, lowering the current draw to about 1 uA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI will not stop SPIM, however EGU does.</title><link>https://devzone.nordicsemi.com/thread/352767?ContentTypeID=1</link><pubDate>Sat, 12 Feb 2022 16:29:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ab46e08-aeef-4208-abe8-f0f6be1fc13f</guid><dc:creator>JosteinBrovold</dc:creator><description>&lt;p&gt;I agree that disabling the peripheral should yield the best power consumption. But I am seeing wildly different behavior depending on how much I use the PPI / EGU.&lt;br /&gt;&lt;br /&gt;With this code, where the PPI is not used at all. And the stop command is not sent, and the SPIM is not disabled (no writing the ENABLE register). I achieve an average current consumption of 1.33 uA for the whole board. Note that the spim_trigger(STOP) is even commented out, and I get good current consumption. However, while using the PPI, and sending the stop function. I have a total current draw of about 500 uA.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
uint32_t ms5803_command(ms5803_command_t command)
{
    transmit_buffer[0] = (uint8_t)command;
    receive_config.max_count = 4;
    spim_set_rx_config(MS5803_SPIM, &amp;amp;receive_config);
    gpio_set_output(MS5803_CS_PIN, 0);
    spim_trigger(MS5803_SPIM, SPIM_TASK_START);
    while(spim_get_event_state(MS5803_SPIM, SPIM_EVENT_END) == 0);
    gpio_set_output(MS5803_CS_PIN, 1);
    spim_reset_event(MS5803_SPIM, SPIM_EVENT_END);
    //spim_trigger(MS5803_SPIM, SPIM_TASK_STOP);
    uint32_t data = 0;
    switch(ms5803_command_length[command])
    {
        case 2: data = (receive_buffer[1] &amp;lt;&amp;lt; 8) | (receive_buffer[2]); break;
        case 3: data = (receive_buffer[1] &amp;lt;&amp;lt; 16) | (receive_buffer[2] &amp;lt;&amp;lt; 8) | (receive_buffer[3]); break;
    }
    return data;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI will not stop SPIM, however EGU does.</title><link>https://devzone.nordicsemi.com/thread/351695?ContentTypeID=1</link><pubDate>Tue, 08 Feb 2022 08:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f44033a1-72f0-4375-b1bf-43720c6d6ef9</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Can you just check that you follow the description for Low power operation in the datasheet?&lt;/p&gt;
&lt;p&gt;When putting the system in low power and the peripheral is not needed, &lt;span style="text-decoration:underline;"&gt;lowest possible power consumption is achieved by stopping, and then disabling the peripheral&lt;/span&gt;.&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;The STOP task may not be always needed (the peripheral might already be stopped), &lt;span style="text-decoration:underline;"&gt;but if it is sent, software shall wait until the STOPPED event was received as a response before disabling the peripheral through the ENABLE register&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>