<?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>Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85557/repeatitive-timer-and-edge-counter-in-nrf5340</link><description>I need repetitive Timer and Edge Counter in my application. There is is a single Timer Peripheral that can be used either as a Timer or Counter. As well, further in counter mode, it is required to count both edges pe second. SO, how can all these be achieved</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Mar 2022 09:15:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85557/repeatitive-timer-and-edge-counter-in-nrf5340" /><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357865?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 09:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:897f1064-1a04-4e72-b787-b15209144b51</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How does your main.c and prj.conf look like now?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357724?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 15:23:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:336c7f16-83fc-4157-b978-9cee64853567</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;After adding the suuggested lines to prj.conf file,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_NRFX_TIMER0=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_NRFX_TIMER1=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;ther is build error as shown in image.&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/pastedimage1647012168437v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357592?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 09:55:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43dbbe51-b6fd-46cd-b0a1-9ccce70099dd</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try these timer instances instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const nrfx_timer_t m_timer_count = NRFX_TIMER_INSTANCE(2);

static const nrfx_timer_t m_timer_read  = NRFX_TIMER_INSTANCE(3);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And set this in prj.conf&lt;/p&gt;
&lt;p&gt;CONFIG_NRFX_TIMER2=y&lt;br /&gt;CONFIG_NRFX_TIMER3=y&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357525?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2022 05:32:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d80ecb8f-8363-4444-ad8d-7f89e241c246</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;I copied some code from the link of example given by you as in attached text file. When, build the error shown in image occurs.&lt;/p&gt;
&lt;p&gt;Gulzar Singh&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646976623425v1.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/tmr.txt"&gt;devzone.nordicsemi.com/.../tmr.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357461?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 14:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7f0b133-864b-4f4f-abff-d9a55a0c7071</guid><dc:creator>Sigurd</dc:creator><description>[quote user="mexco"]Form above it is not clear that which Timer has been used in it ?[/quote]
&lt;p&gt;The zephyr kernel timer is using RTC1&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/timer/Kconfig.nrf_rtc#L11"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/timer/Kconfig.nrf_rtc#L11&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357337?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2022 09:06:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76c24bec-e0e8-4d53-9db0-f9d710e7325e</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hi, I have already used a Timer using Zephyr Kernel s below:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;K_WORK_DEFINE(my_work, my_work_handler);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;void my_timer_handler(struct k_timer *dummy)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; k_work_submit(&amp;amp;my_work);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;K_TIMER_DEFINE(my_timer, my_timer_handler, NULL);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;void my_work_handler(struct k_work *work)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;k_timer_start(&amp;amp;my_timer, K_SECONDS(4), K_SECONDS(30));&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Form above it is not clear that which Timer has been used in it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeatitive Timer and Edge Counter in nRF5340</title><link>https://devzone.nordicsemi.com/thread/357040?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 08:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:841c471a-247e-4e71-a3d5-20a37ae0d0c5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I believe I have some code here that does what you describe:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c"&gt;https://github.com/sigurdnev/ncs-playground/blob/master/samples/pulse_detector/src/main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>