<?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>A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84970/a-silly-question-about-timer-register-triggers</link><description>I&amp;#39;m sorry. This must be trivial to all of you. I&amp;#39;m a beginner with nrf52 programming, and I saw several examples that refer to timers TASK_START, TASK_CLEAR, TASK_STOP. Everywhere, it just sets them to &amp;quot;1&amp;quot;. However the datasheet says that it&amp;#39;s a trigger</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Mar 2022 15:38:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84970/a-silly-question-about-timer-register-triggers" /><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355629?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:38:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d118356-5f81-4a69-b130-6d3688a96775</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;Hi Elfving, I think we have concluded as much :)&amp;nbsp; So unless someone contradicts, I figure that writing 1 to a timer task register creates a single clock cycle pulse.&lt;/p&gt;
&lt;p&gt;Thanks again for the enormous attention and patience,&lt;/p&gt;
&lt;p&gt;Matan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355612?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:04:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e04dc8ac-6e35-41eb-a67f-c3ea3e83759f</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="matangk"]1. For interrupts, I know that if an interrupt has been defined and attached, the compare event must be reset so it doesn&amp;#39;t keep calling the interrupts.[/quote]
&lt;p&gt;Correct.&lt;/p&gt;
[quote user="matangk"]&lt;p&gt;2. I asked about what brings the timer START, STOP, and CLEAR task flags back to 0, after a program sets them to 1, since in the examples that I saw this isn&amp;#39;t done explicitly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote][quote user="matangk"]My question was not general about tasks. It was specific about timers&amp;#39;&amp;nbsp;&amp;nbsp;&lt;span&gt;TASK_START, TASK_CLEAR, TASK_STOP tasks and what sets their flag back to zero.&lt;/span&gt;[/quote]
&lt;p&gt;The value being written there isn&amp;#39;t being retained. It just creates a signal.&amp;nbsp;There is info in the product specification about this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646146820207v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355611?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:04:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e329ab0-850e-4ae0-94f4-d4653ddb4bc0</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;TASK_CLEAR = 1 =&amp;gt; Resets counter to zero&lt;/p&gt;
&lt;p&gt;TASK_START = 1 =&amp;gt; Starts timer counter and runs until TASK_STOP is set to 1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;TASK_STOP = 1 =&amp;gt; Stops timer counter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355565?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 13:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:493ce6cb-25be-4d5b-b40b-b22ff12abdcb</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;Hi Nguyen.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve completely lost you there.&lt;/p&gt;
&lt;p&gt;1. For interrupts, I know that if an interrupt has been defined and attached, the compare event must be reset so it doesn&amp;#39;t keep calling the interrupts. That was not my question.&lt;/p&gt;
&lt;p&gt;2. I asked about what brings the timer START, STOP, and CLEAR task flags back to 0, after a program sets them to 1, since in the examples that I saw this isn&amp;#39;t done explicitly.&lt;/p&gt;
&lt;p&gt;3. As per Elfving when these tasks are executed, the flag goes to 0 automatically one clock cycle later.&lt;/p&gt;
&lt;p&gt;Can you please confirm or contradict? My question has nothing to do with compare or overflow.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355552?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 12:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8a6f3eb-e7e7-4e72-b90f-82c41dbd1fb5</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Once the compare event happened, it will generate an interrupt. If you don&amp;#39;t set it to zero, you&amp;#39;ll interrupt continuously. &amp;nbsp;The counter continues to count since the task is not stopped. After overflow, it will reset to zero and continue to count then reach the compare value again until you set the stop task.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Brief, the task is for starting and stopping the counter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355462?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 09:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ad9ad5-81f8-47fe-a844-ff341cdf9ee8</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the answer. My question was not general about tasks. It was specific about timers&amp;#39;&amp;nbsp;&amp;nbsp;&lt;span&gt;TASK_START, TASK_CLEAR, TASK_STOP tasks and what sets their flag back to zero. both of you are giving contradicting answer:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. You say that it happens automatically after &lt;strong&gt;one clock cycle&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Nguyen says that &lt;strong&gt;I must write &amp;quot;0&amp;quot;&lt;/strong&gt; to&amp;nbsp;EVENTS_COMPARE[X] to reset the triggered events flag (also can happen on it&amp;#39;s own when &lt;strong&gt;timer&amp;#39;s done&lt;/strong&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which is the correct answer in this specific situation?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355456?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 08:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e29f9bf6-7eed-4bb4-9536-881eb3700d10</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Nguyen is talking about EVENTS, which can affect TASKS. I am talking about TASKS in general, which I assumed was what you were asking about.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355269?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 12:40:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f16ff2a0-4b31-415d-8a6f-ae7cc7a1d0bd</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;Well there&amp;#39;s a contradiction then between you and Nguyen&amp;#39;s reply...&lt;/p&gt;
&lt;p&gt;What he says is:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;you reset it by writing a 0 to the EVENTS_?? registers. &amp;nbsp;EVENTS_COMPARE[I] = 0 for triggered events.&amp;nbsp;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You, however, say that the timer tasks&amp;nbsp;TASK_START, TASK_CLEAR, TASK_STOP are &amp;quot;being automatically reset after one clock cycle&amp;quot; (essentially a single clock cycle one shot).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;so.. which one is it?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355259?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 11:53:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35fc99d4-dffc-46cc-bbae-56dfc685abc5</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;For more info on the TIMER you can read about it in the product specification. You can think of it as it being automatically reset after one clock cycle, but it isn&amp;#39;t edge triggered. It is guaranteed to take effect within one clock cycle.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355128?ContentTypeID=1</link><pubDate>Sat, 26 Feb 2022 09:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d086cc74-e205-424a-9289-5e6c60b5707b</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;not totally, that reset the trigger interrupt. &amp;nbsp;To stop the trigger completely is another thing. see the disable trigger function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355126?ContentTypeID=1</link><pubDate>Sat, 26 Feb 2022 08:07:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd4cd7a-303b-427e-9283-816b3a39740f</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;So.. resetting the match compare resets the timer task registers? It makes sense since resetting the match should in practice indicate the end of a desired timer operation. Though not very intuitive for me.. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355107?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 20:11:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb5c7a6b-1c89-485f-9467-13316d8afce1</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;No, you reset it by writing a 0 to the EVENTS_?? registers. &amp;nbsp;EVENTS_COMPARE[I] = 0 for triggered events. &amp;nbsp;EVENTS_OVRFLW = 0 to reset overflow events&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;See implementation here&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Low freq clock :&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/timer_lf_nrfx.cpp"&gt;https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/timer_lf_nrfx.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;High freq clock : &lt;a href="https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/timer_hf_nrfx.cpp"&gt;https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/timer_hf_nrfx.cpp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355102?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 18:34:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:356af049-eee8-4304-9d0d-69b24020b183</guid><dc:creator>matangk</dc:creator><description>&lt;p&gt;Ok.. thanks. A bit cryptic there.. So edge triggered or not it must have some auto-reset, I guess?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/355060?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 14:09:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbf7a206-c6fe-4e2e-9f91-1447c9206f7f</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hey again,&lt;/p&gt;
[quote user=""]I&amp;#39;m sorry.[/quote]
&lt;p&gt;No problem at all!&lt;/p&gt;
[quote user=""]So.. What resets the trigger flag then?[/quote]
&lt;p&gt;It isn&amp;#39;t edge triggered.&lt;/p&gt;
&lt;p&gt;Those are write only registers, they won&amp;#39;t be reset back to zero. Every time you write 1 to the register the internal task gets activated. which starts the internal task signal. You don&amp;#39;t have to worry about resetting them to 0, or worry about activating them too frequently.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A silly question about timer register triggers</title><link>https://devzone.nordicsemi.com/thread/354651?ContentTypeID=1</link><pubDate>Wed, 23 Feb 2022 15:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db551386-8a27-4845-b4c5-8048442686ed</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I will have to get back to you on this.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>