<?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>Simple timer as counter</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89825/simple-timer-as-counter</link><description>Hello, 
 I want to use app_simple_timer as a counter - I am trying to access the current number of ticks at regular intervals, something in the style of what was suggested here (see also pasted code below). 
 Is there a straightforward way of doing this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jul 2022 10:57:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89825/simple-timer-as-counter" /><item><title>RE: Simple timer as counter</title><link>https://devzone.nordicsemi.com/thread/376388?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2022 10:57:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7da9eacf-d923-4ed3-8e5d-9cfed50f0c79</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Oskar,&lt;br /&gt;&lt;br /&gt;If you would like to capture the value of a TIMER instance you could use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrfx__timer.html?cp=8_1_6_8_0_37_1_6#gae398466a8a82d9c5f2c1865140de4384"&gt;nrfx_timer_capture&lt;/a&gt; or &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrfx__timer.html?cp=8_1_6_8_0_37_1_7#ga466adad4068053ef9e6a08072ce6d75d"&gt;nrfx_timer_capture_get&lt;/a&gt;&amp;nbsp;functions to do so.&lt;br /&gt;Make sure you are &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s112/SDS/s1xx/sd_resource_reqs/hw_block_interrupt_vector.html"&gt;not using TIMER0 or RTC0 since these peripherals are&amp;nbsp;&lt;em&gt;blocked&lt;/em&gt; by the SoftDevice (if present)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple timer as counter</title><link>https://devzone.nordicsemi.com/thread/376361?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2022 08:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67e8f4ab-0773-40ba-84f9-49b09981ab9e</guid><dc:creator>oskarbjo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for the suggestion but it seems that you are using the RTC and the 32kHz clock while I am trying to use the 32MHz clock.&lt;/p&gt;
&lt;p&gt;My application could perhaps do with the 32 kHz instead, but I am using an NRF52820 which only has two RTCs and both of these are already in use unfortunately&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple timer as counter</title><link>https://devzone.nordicsemi.com/thread/376291?ContentTypeID=1</link><pubDate>Sat, 09 Jul 2022 15:25:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72c76bfc-70b6-4428-b085-067bffaaf731</guid><dc:creator>Jimmywong2003</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can refer to my github to get the timer tick.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t counter_get(void)
{
    return(nrf_drv_rtc_counter_get(&amp;amp;m_rtc));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://github.com/jimmywong2003/nrf5-ble-bidirection-throughput-test/blob/master/module/counter.c"&gt;https://github.com/jimmywong2003/nrf5-ble-bidirection-throughput-test/blob/master/module/counter.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>