<?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>Calculation of time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83598/calculation-of-time</link><description>Hi Team, 
 
 Does it have some functions to calculate the working time from the starting point on nrf52850 chips? 
 
 
 Best, 
 Gaosheng</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Jan 2022 12:30:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83598/calculation-of-time" /><item><title>RE: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347573?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 12:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1f6369f-0f9f-4aac-b887-ef74863559b0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;From your other tickets it seems that you are using the nRF5 SDK, in which case you can see a demonstration of the RTC peripheral usage in &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/rtc_example.html"&gt;the RTC peripheral example&lt;/a&gt;, or you could read about&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_timer.html"&gt;the app_timer library here&lt;/a&gt;&amp;nbsp;- the app_timer library is also extensively used in the BLE peripheral examples in the SDK, if you want to see its usage demonstrated.&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: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347543?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 10:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46d6bbfa-5f86-403b-b348-882c59c35a0c</guid><dc:creator>lgs</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks! The last question: Do you have any examples for recording time?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With best regards,&lt;/p&gt;
&lt;p&gt;Gaosheng&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347535?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 09:18:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb1a50fb-91d6-4e50-88a2-02bd4619c204</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again, Gaosheng&lt;br /&gt;&lt;br /&gt;Aha, I see - then I suggest setting up an RTC or app_timer instance at the beginning of your main(), and then write its value to FLASH every so often. Using the RTC or app_timer instance will have a lower power consumption as well as a lower accuracy than using the TIMER peripheral for this task. Since you only need accuracy in the ms magnitude it will be totally fine to use the low power options for this.&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: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347515?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 08:08:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1a080e8-ce32-4eb6-bad2-d7be97f1685c</guid><dc:creator>lgs</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;My requirement is to calculate the time from the starting point to the drown-out. I want to preserve the value on flash memory. Then next time, I can read from the flash memory. The resolution I think it is ms level.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gaosheng&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347511?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 07:59:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b63aff6-9c65-49ac-9fd8-d0f3b4548209</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Oh, I see - thank you for clarifying.&lt;br /&gt;&lt;br /&gt;There is no innate function for checking time since chip startup, but you could start a timer at the beginning of your main function and read that out later to see how long time the device has been on for. This will however only capture that time that code has been executing on the chip, so it does not encompass the time it took to power up and run the code to start the timer.&lt;br /&gt;&lt;br /&gt;What are your requirements for your timing - how accurate does it need to be, and what resolution are you looking for?&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: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347507?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 07:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ccccd7-7eb1-40ba-a4c9-a92a1ad592e2</guid><dc:creator>lgs</dc:creator><description>&lt;p&gt;Sorry for typing errors, I mean nrf52840 chips.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculation of time</title><link>https://devzone.nordicsemi.com/thread/347505?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 07:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e70ecf1-81ac-4a23-829e-97f961617670</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;The MSP430FR5994&lt;span&gt;&amp;nbsp;is not a Nordic Semiconductor product, so we do not provide technical support for it here in the DevZone forum.&lt;br /&gt;I would recommend that you open a ticket for this in a Texas Instrument forum instead.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>