<?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 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57372/nrf52832-how-to-use-ppi-to-do-a-capture-compare-on-a-timer-and-also-disable-that-compare</link><description>Hi. I am using timers and PPI to do frequency counting. 
 The basic process is for 1 PPI channel to incriment a timer, and then a second PPI on a second timer to stop the counter after 10mS. 
 The captured value is then read, and all the timers reset</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Jul 2021 20:46:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57372/nrf52832-how-to-use-ppi-to-do-a-capture-compare-on-a-timer-and-also-disable-that-compare" /><item><title>RE: nRF52832 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/thread/321905?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 20:46:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e54055a3-e1cb-4276-826d-5a4106efbe1b</guid><dc:creator>nothingmuchyou</dc:creator><description>&lt;p&gt;Can a nordic engineer give an answer to this question? What&amp;#39;s the best way to enable/disable timer channels without stopping the channel (in the case that other timer channels are in use?)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/thread/232785?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 10:35:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44e40f5b-0ce5-479a-bbe4-be64c69cf18f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Maybe the&amp;nbsp;\nRF5_SDK_16.0.0_98a08e2\examples\peripheral\timer ?&lt;/p&gt;
&lt;p&gt;You need to disable it on&amp;nbsp;NRF_TIMER_EVENT_COMPARE0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/thread/232766?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 09:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63782ab6-4cb5-4662-865e-a4ccfee8bbae</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;Hi Kenneth.&lt;/p&gt;
&lt;p&gt;Are there any examples in the SDK on how to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/thread/232727?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 07:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93001f08-0ded-4e23-b9d8-8fc737ef8e51</guid><dc:creator>Kenneth</dc:creator><description>[quote user="philipm"]Basically how do you use a timer compare to trigger a capture only once, and then disable that capture which the timer carries on running?[/quote]
&lt;p&gt;In such case you must enable an interrupt on the specific timer compare to disable it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 how to use PPI to do a capture compare on a timer, and also disable that compare?</title><link>https://devzone.nordicsemi.com/thread/232658?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2020 16:44:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dfc5361-24ec-48cd-9169-e40ca5088130</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;I think I have found an issue. I configure 2 compares for my timer4, but I read in another question that &amp;#39;NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK&amp;#39; will clear the whole timer not just the compare?&lt;/p&gt;
&lt;p&gt;What is the point of &amp;#39;NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK&amp;#39; if you can&amp;#39;t clear individual compare channels? I don&amp;#39;t want the clear the whole timer at this 5mS compare event, just the compare. Is there a way to do that?&lt;/p&gt;
&lt;p&gt;Basically how do you use a timer compare to trigger a capture only once, and then disable that capture which the timer carries on running?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void timer4_init(void)
{
    // Check TIMER2 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
    
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer4, &amp;amp;timer_cfg, NULL);
    error_check(err_code);

    //compare 1
    nrf_drv_timer_extended_compare(&amp;amp;m_timer4,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer4, 15),  //15mS
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);

    //compare 2
    nrf_drv_timer_extended_compare(&amp;amp;m_timer4,
                                   NRF_TIMER_CC_CHANNEL1,
                                   nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer4, 5),  //5mS
                                   NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK,
                                   false);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>