<?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>how to stop a timer ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66964/how-to-stop-a-timer</link><description>I am using 2 counters, one to produce the 4MHz, and the other for the 62.5KHz, to drive I2S module. 
 I need to find a way to stop the first counter (4MHz) after it produces a certain number of ticks (for example 512 ticks). 
 If I use the code (attached</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Oct 2020 14:19:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66964/how-to-stop-a-timer" /><item><title>RE: how to stop a timer ?</title><link>https://devzone.nordicsemi.com/thread/274373?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 14:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea7b5da3-ca90-4a3b-bdab-a5498e47ea19</guid><dc:creator>sgabran</dc:creator><description>&lt;p&gt;thanks a lot, all the best&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to stop a timer ?</title><link>https://devzone.nordicsemi.com/thread/274371?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 14:11:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ecfb736-1d21-46e0-9da0-abf568eb3931</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I would recommend you to have a look at the examples in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34547/ppi-configuration-to-count-pulses/133136#133136"&gt;this post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to stop a timer ?</title><link>https://devzone.nordicsemi.com/thread/274369?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 14:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6fd861a-0aaf-4f4f-939a-42f0de7d97ce</guid><dc:creator>sgabran</dc:creator><description>&lt;p&gt;Hi Jorgen&lt;/p&gt;
&lt;p&gt;Thanks a lot for the advice. I am trying to do the connection between timer-0 counts and counter-1 using PPI channel-3 (assuming this is the right way to do it)&lt;/p&gt;
&lt;p&gt;I believe this line will monitor the compare event on timer-0.&lt;/p&gt;
&lt;p&gt;What is it the command to use to trigger the counts on counter-1 ?&lt;/p&gt;
&lt;p&gt;many thanks&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;compare_event_addr_3 = nrf_drv_timer_event_address_get(&amp;amp;Timer_0, NRF_TIMER_EVENT_COMPARE0);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to stop a timer ?</title><link>https://devzone.nordicsemi.com/thread/274243?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 09:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c69db26-ecd0-4a15-abff-2605e923250c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You have two options to do this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable interrupts for the timer events. Increment a counter in the event handler, when it reaches 512, stop the timer. This approach may not work well for high-frequency timers, as the interrupt latency may cause additional pulses to be clocked out before you are able to stop the timer.&lt;/li&gt;
&lt;li&gt;Use a second timer in COUNT mode. Connect the COMPARE event of the clock-generating timer to the COUNT task of the second timer. Set he CC register of the counting-timer to the number of clock cycles you want to stop the first timer at, then connect the COMPARE event from the counting timer to the STOP task of the clock-generating timer.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>