<?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 usage white paper?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15138/ppi-usage-white-paper</link><description>Does there exist a white paper describing some typical PPI use cases with coding examples? The only one I&amp;#39;ve found is the peripheral/gpiote example and it is severely lacking any explanatory comments. Looking at the relevant functions in the info-center</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Jul 2016 06:21:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15138/ppi-usage-white-paper" /><item><title>RE: PPI usage white paper?</title><link>https://devzone.nordicsemi.com/thread/57784?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2016 06:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:821b9708-ebee-4c7c-99d3-19155454b85a</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Well sure, just initialize the clock through the SoftDevice API. See the updated code above. To release the hfclk call sd_clock_hfclk_release(), which will happen immediately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI usage white paper?</title><link>https://devzone.nordicsemi.com/thread/57783?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 20:05:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66588c45-914b-4a5d-8b96-68636fabc162</guid><dc:creator>Bret Foreman</dc:creator><description>&lt;p&gt;Øyvind,&lt;/p&gt;
&lt;p&gt;Won&amp;#39;t the direct use of TIMER1 in the way you show above cause a conflict with the SoftDevice? I&amp;#39;m under the impression that timer control needs to go through the SD APIs when the SD is running.&lt;/p&gt;
&lt;p&gt;Bret&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI usage white paper?</title><link>https://devzone.nordicsemi.com/thread/57782?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 06:28:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff35afd9-7bf9-4637-b403-c62538020800</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I wrote some code for this earlier, for 4 MHz output on pin 18 set NRF_TIMER1-&amp;gt;CC[0] = 8;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    // Set up GPIO as output
    nrf_gpio_range_cfg_output(17, 18);
    nrf_gpio_pin_clear(17); // Light LED 1 to indicate that the code is running
    
    // Start high frequency clock without SoftDevice
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
    {
        // Wait for clock to start
    }

    // Start high frequency clock with SoftDevice
    uint32_t running;
    sd_clock_hfclk_request();
    sd_clock_hfclk_is_running(&amp;amp;running);
    while(!running)
    {
        sd_clock_hfclk_is_running(&amp;amp;running);
        //Wait for clock to start
    }

    NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
    
    // Configure GPIOTE to toggle pin 18 
    NRF_GPIOTE-&amp;gt;CONFIG[0] = GPIOTE_CONFIG_MODE_Task &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos |
                            GPIOTE_CONFIG_POLARITY_Toggle &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos |
                            18 &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos | 
                            GPIOTE_CONFIG_OUTINIT_Low &amp;lt;&amp;lt; GPIOTE_CONFIG_OUTINIT_Pos;
                            
    // Set up timer
    NRF_TIMER1-&amp;gt;PRESCALER = 0;
    NRF_TIMER1-&amp;gt;CC[0] = 2; // Adjust the output frequency by adjusting the CC.
    NRF_TIMER1-&amp;gt;SHORTS = TIMER_SHORTS_COMPARE0_CLEAR_Enabled &amp;lt;&amp;lt; TIMER_SHORTS_COMPARE0_CLEAR_Pos;
    NRF_TIMER1-&amp;gt;TASKS_START = 1;
        
    // Set up PPI to connect the timer compare event with the GPIOTE toggle task
    NRF_PPI-&amp;gt;CH[0].EEP = (uint32_t) &amp;amp;NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0];
    NRF_PPI-&amp;gt;CH[0].TEP = (uint32_t) &amp;amp;NRF_GPIOTE-&amp;gt;TASKS_OUT[0];
    
    NRF_PPI-&amp;gt;CHENSET = PPI_CHENSET_CH0_Enabled &amp;lt;&amp;lt; PPI_CHENSET_CH0_Pos;
    
    while (true)
    {
       
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also see &lt;a href="https://devzone.nordicsemi.com/question/76996/nrf52-1-4-mhz-clock-needed/"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>