<?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>NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57767/nrf52832-nrfx_timer-can-not-reach-the-accuracy-of-microsecond</link><description>Hi gays, 
 Now, I want to c ollect a pulse waveform(example : 1s, 50% duty cycle ) which accuracy requires milliseconds resolution and I use PPI to read a capture value from timer,but I see the accuracy drifting. The problem is that i can not reach the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Feb 2020 08:23:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57767/nrf52832-nrfx_timer-can-not-reach-the-accuracy-of-microsecond" /><item><title>RE: NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/thread/235078?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 08:23:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:287c2dfd-a26d-49c7-b3ef-77ee2191e135</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What is&amp;nbsp;the period of the signal coming from the 2. DK if you measure it with an oscilloscope or digital analyzer?&lt;br /&gt;&lt;br /&gt;Something is definitely wrong, even the RTC should do &amp;lt; µs accuracy with the LFXO enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/thread/234608?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 10:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61333eaa-e626-4f58-96e8-b0b98e1828a0</guid><dc:creator>nicholas_cage</dc:creator><description>&lt;p&gt;Thanks for your reply .&lt;span&gt;I have learned a lot&amp;nbsp; and&lt;/span&gt; I would show your more details about my configuration.&lt;/p&gt;
&lt;p&gt;Gpiote configuration:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);&amp;nbsp; //&amp;nbsp;&lt;span&gt;high accruacy&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;in_config.pull = NRF_GPIO_PIN_PULLUP;&lt;/p&gt;
&lt;p&gt;Signal source of&amp;nbsp;&lt;span&gt;pulse waveform:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;using another DK borad with timer (16MHz ), &lt;/span&gt;&lt;span&gt;toggle the level of pin in the&amp;nbsp; interrupt handler&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Clock&amp;nbsp; &amp;nbsp;configuration :&lt;/span&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clock_start()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&amp;nbsp; &amp;nbsp;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTATED = 0;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // using HFXO&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) ;&amp;nbsp; }&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i am developing a project with&amp;nbsp;&lt;em&gt;&lt;span class="skip"&gt; electricity meter which need &lt;span&gt;high&amp;nbsp;&lt;/span&gt;&lt;span&gt;resolution&amp;nbsp; (several&amp;nbsp; ms ).&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now ,i already&amp;nbsp; &lt;span&gt;&amp;nbsp;configured the GPIOTE driver to use &amp;quot;high&amp;quot;&amp;nbsp; accruacy and use&amp;nbsp;&amp;nbsp;HFXO.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="tran"&gt;After&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;several&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;repetitions&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;there&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;still remains&lt;/span&gt;&lt;span&gt; an &lt;/span&gt;&lt;span class="tran"&gt;error.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are other ways to improve the accruacy?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/thread/234396?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 12:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7c84a22-bc72-49e7-9170-5c46a471a124</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;This makes things a bit clearer, but there&amp;#39;s still some information that is lacking.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As I understand it you are using an external source to trigger either an &lt;span&gt;EVENTS_IN&amp;nbsp;&lt;/span&gt;or a &lt;span&gt;EVENTS_PORT&amp;nbsp;&lt;/span&gt;on a GPIO, but I do not know which. Have you configured the GPIOTE driver to use &amp;quot;high&amp;quot; or &amp;quot;low&amp;quot; accruacy?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;And what source are you using to trigger the gpio pin? Is it a signal generator that operates at 1Hz? If so what&amp;#39;s the frequency accuracy of that signal generator, in that mode, at that frequency?&lt;/p&gt;
&lt;p&gt;Another way to check the accuracy of the TIMER is to use it to trigger the toggling of a GPIOTE pin and analyze the period of the resulting waveform with an oscilloscope or digital analyzer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You are also confusing the term accuracy with resolution. Accuracy or Tolerance, in regards to a clock source, is the deviation in frequency from its intended target, often measured in Parts Per Million. The nRF52832&amp;#39;s&amp;nbsp;&lt;a title="  64 MHz internal oscillator (HFINT)  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_3_0#unique_1861058799"&gt;64 MHz internal oscillator (HFINT)&lt;/a&gt;&amp;nbsp;has a tolerance of &amp;lt;+/-6% maximum, whereas the&amp;nbsp;&lt;a title="  64 MHz crystal oscillator (HFXO)  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_3_1#unique_1749008215"&gt;64 MHz crystal oscillator (HFXO)&lt;/a&gt;&amp;nbsp;has a tolerance&amp;nbsp;given by the external crystal, most often +/- 40ppm.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If you&amp;#39;re not using the HFXO as the clock source then you should expect a pulse width of 500ms +/- 30ms.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If you are using the&amp;nbsp;&lt;span&gt;HFXO as the clock source on the dev kit then you should expect a pulse width of 500ms +/- 30ppm = &lt;span style="text-decoration:underline;"&gt;500ms +/- 17ns&lt;/span&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The resolution is the frequency of the timer. The maximum frequency of the TIMER is 16MHz, or 62.5ns period.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The drift is the change in accuracy/tolerance over time or temperature( or any other operational parameter).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s also&amp;nbsp;jitter/phase noise, which is the variation in frequency from period to period, though this parameter is not really that important unless you&amp;#39;re doing som really high-frequency stuff, like our 2.4GHz radio does.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/thread/234296?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 02:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaae6808-ec3e-484a-a7b9-6936845f4496</guid><dc:creator>nicholas_cage</dc:creator><description>&lt;p&gt;i am sorry for not do that. I use a timer(16 MHZ) to collect&amp;nbsp;&lt;span&gt;&amp;nbsp;a pulse waveform( 1s, 50% duty cycle )&amp;nbsp; through PPI.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;My collected data (capture value)&amp;nbsp; are shown below.&amp;nbsp;&lt;/p&gt;
&lt;table style="height:42px;width:323px;" height="15"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="font-weight:400;" width="117"&gt;10646513&amp;nbsp; 18682896 26718977 34756745&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;the first interval=(&lt;span&gt;18682896-&lt;/span&gt;&lt;span&gt;10646513&lt;/span&gt;)* 0.0625 *0.000001=0.5022739 s&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the second =&lt;span&gt;(26718977&lt;/span&gt;&lt;span&gt;&amp;nbsp;-&lt;/span&gt;&lt;span&gt;&amp;nbsp;18682896&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;) * 0.0625 *0.000001= 0.50225063 s&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp; third =&lt;span&gt;(34756745&lt;/span&gt;&lt;span&gt;&amp;nbsp;-&lt;/span&gt;&lt;span&gt;&amp;nbsp;26718977&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;) * 0.0625 *0.000001= 0.5023605 s&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; I suppose that the result of interval time&amp;nbsp; should be 0.5000000 s ,because the accuracy of timer is 0.0625&amp;nbsp;&amp;mu;s.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52832 nrfx_timer can not reach the accuracy of microsecond?</title><link>https://devzone.nordicsemi.com/thread/234159?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2020 11:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b72c266a-fa91-4f36-90c8-77aec9dbf7e0</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;It&amp;#39;s not clear to us what your problem is. You talk about accuracy, resolution, and drift, without giving us any numbers.&lt;br /&gt;&lt;br /&gt;What did you expect to observe and what did you actually observe?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>