<?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>About Current Time Service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58195/about-current-time-service</link><description>Hello, I am a newb currently working to be able to send and receive timestamps between two nrf52840 dk&amp;#39;s. 
 I have been successful in creating a space in the advertising packets to place an initialized timer value. 
 However, I soon realized that this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Feb 2020 09:05:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58195/about-current-time-service" /><item><title>RE: About Current Time Service</title><link>https://devzone.nordicsemi.com/thread/237061?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 09:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2a57a87-6e8d-4974-a866-15c063960b4a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Marty&lt;/p&gt;
&lt;p&gt;The problem with nanosecond accuracy is that you need very fast and accurate clocks, which will impact the cost, complexity and power consumption of your solution, but hopefully you can find something out there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The ble_app_uart example can be configured in different ways, but at a minimum you should have 20 bytes available in each characteristic, and you can configure the size up to 512 bytes if you want, so there should be plenty of room for a 4 byte timestamp &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Current Time Service</title><link>https://devzone.nordicsemi.com/thread/236684?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 05:48:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b4e224d-dab7-4ad8-8f9b-07f278cd24e7</guid><dc:creator>marty9410</dc:creator><description>&lt;p&gt;Thank you for the specific reply, Torbjorn! It&amp;#39;s a shame I can&amp;#39;t achieve the nanosecond accuracy portion from this device, but I guess I&amp;#39;ll have to cope with an alternative solution-&lt;/p&gt;
&lt;p&gt;and about one of my questions-&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/58195/about-current-time-service/236577"]Do you mean for the timestamp information, or how many bytes you have available in total?[/quote]
&lt;p&gt;Sorry for the vague question- what I meant was how many bytes I&amp;#39;d have available in total; I need at least 32 bits - which is 4 bytes that is available to me.&lt;/p&gt;
&lt;p&gt;But I&amp;#39;m guessing the storage is not a problem in this type of packet;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;anyways, Thank you so much for your help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Marty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Current Time Service</title><link>https://devzone.nordicsemi.com/thread/236577?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 13:54:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:130de1ad-e142-4c22-ba0a-e30d47114a4d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
[quote user="marty9410"]If I understood your comment properly, I would have more freedom in regards to how I would format the information I&amp;#39;m sending, right?[/quote]
&lt;p&gt;That is correct. You can fill the characteristics with whatever information you like, and also extend the example to use more services if you want. The only critical thing is that you change the UUID of the example to avoid mixing your device up with any other running the Nordic UART service.&amp;nbsp;&lt;/p&gt;
[quote user="marty9410"]How many bytes would I be looking at if I used the uart example?&amp;nbsp;[/quote]
&lt;p&gt;Do you mean for the timestamp information, or how many bytes you have available in total?&lt;/p&gt;
[quote user="marty9410"]Also, we&amp;#39;re trying to send timestamps down to the nano second accuracy- if millisecond accuracy is challenging, does this mean achieving nanosecond accuracy is impossible? Or would there be a method to accomplish this task?[/quote]
&lt;p&gt;Yes, I don&amp;#39;t see how you would be able to get accuracy this good. At a minimum you will have uncertainty caused by clock drift between the TX and RX, which means the clocks between them will be in different phase compared to each other. Over time this phase will change and add at least up to 62.5ns of uncertainty between the two.&lt;/p&gt;
&lt;p&gt;Secondly the tolerance of the clock source will add uncertainty over time. The external high frequency crystal can have a tolerance of up to 50ppm, which means you could have up to 50us drift every second. This means that the accuracy will deteriorate slowly whenever you let the nRF device keep time without setting it from some external source.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With consumer electronics like this you will definitely not get nanosecond accuracy.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Current Time Service</title><link>https://devzone.nordicsemi.com/thread/236199?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 10:11:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6047347a-07cc-45bd-a774-fa3f36b86e99</guid><dc:creator>marty9410</dc:creator><description>&lt;p&gt;Thank you for the response, ovrebekk!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I understood your comment properly, I would have more freedom in regards to how I would format the information I&amp;#39;m sending, right? How many bytes would I be looking at if I used the uart example?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, we&amp;#39;re trying to send timestamps down to the nano second accuracy- if millisecond accuracy is challenging, does this mean achieving nanosecond accuracy is impossible? Or would there be a method to accomplish this task?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: About Current Time Service</title><link>https://devzone.nordicsemi.com/thread/236168?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 08:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef79713b-eca7-4a86-8153-1ba4ba5ba54d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;If you are doing something proprietary, that doesn&amp;#39;t have to be compatible with any existing systems out there, then it might be easier just to use the ble_app_uart example as a starting point.&amp;nbsp;&lt;br /&gt;With this example you can send strings of any length between the two devices,&amp;nbsp;or send data of any format, such as a timestamp.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The CTS service is very useful if you want to connect to a phone, and get an accurate timestamp sent from the phone side, but is harder to setup if you just want two Nordic kits to communicate with each other.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The TIMER modules have higher accuracy, that is correct. While an RTC tick is about 30.5us in length, the TIMER can run down to a 62.5ns interval (16MHz base clock).&amp;nbsp;&lt;br /&gt;But it&amp;#39;s not only the accuracy that is important, but also the frequency tolerance. The TIMER module runs from the high frequency clock (HFCLK), and to get good tolerance it is necessary to enable the external 32MHz crystal at all times. This will give you a tolerance of 50ppm or better depending on the type of crystal used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using the RTC the tolerance is set&amp;nbsp;either by the internal 32.768kHz RC oscillator, which is not very accurate, or the external 32.768 kHz crystal, which can have a tolerance of 20ppm or better. In this case it is also necessary to enable the external crystal explicitly to ensure good frequency tolerance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A final word of caution is that there is some delay in the Bluetooth link layer that makes it hard to send very accurate timing information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need accuracy on the second level this is probably not an issue, but if you are trying to send millisecond accurate time stamps this can be more challenging.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>