<?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>Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111923/measure-lfxo-32-768-khz-on-nrf5340</link><description>Hi there 
 I want to measure the accuracy of the 32.768 kHz oscillator connected to a nRF5340 
 I have tried a lot of other devzone tickets, but most of them are too old or don&amp;#39;t work for nRF5340. 
 I also tried to use a pwm-led output with 4096Hz to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Jun 2024 11:42:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111923/measure-lfxo-32-768-khz-on-nrf5340" /><item><title>RE: Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/thread/488850?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 11:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc8c1012-3754-4af8-979e-b68de09c9de2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The sample should work well. But note that this compares HF and LF clock source, which is not the same as measuring with a known good (and probably regularily calibrated) instrument. If both the HF and LF clock are off in the same direction and same relative order of magnitude, you could get very good results here even thought the clocks may not be that accurate. Depending on what you are going to use your measurements for that may or may not be a problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/thread/488797?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 06:56:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42a788ef-6b62-498f-9926-fdbe8c957930</guid><dc:creator>ChriglSEI</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have also found the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.zephyrproject.org/latest/samples/boards/nrf/clock_skew/README.html"&gt;Clock_skew sample&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have tuned the HFXO-crystal earlier with an frequency spectrum analyzer and hence, I know the accuracy of the HFXO.&lt;/p&gt;
&lt;p&gt;With&amp;nbsp;&lt;span&gt;CONFIG_APP_ENABLE_HFXO&lt;/span&gt;&lt;span&gt;=y set in the example, I get a err of the LFXO in ppb which matches my measurements with k_uptime_get() over several hours.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will further test the sample, but it looks promissing&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The sample prints:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;*** Booting nRF Connect SDK 3758bcbfa5cd ***&lt;br /&gt;Power-up clocks: LFCLK[ON]: Running LFXO ; HFCLK[OFF]: Off HFINT&lt;br /&gt;Enable HFXO got 0&lt;br /&gt;Start timer@f000: 0&lt;br /&gt;Timer-running clocks: LFCLK[ON]: Running LFXO ; HFCLK[ON]: Running HFXO&lt;br /&gt;Checking timer@f000 at 16000000 Hz against ticks at 32768 Hz&lt;br /&gt;Timer wraps every 268 s&lt;br /&gt;Started sync: 1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ty&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Latest&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Base&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Span&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Err&lt;br /&gt;HF&amp;nbsp; &amp;nbsp; &amp;nbsp; 00:08:21.281414&amp;nbsp; &amp;nbsp; &amp;nbsp;00:00:00.017208&amp;nbsp; &amp;nbsp;00:08:21.264206&lt;br /&gt;LF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;00:08:21.972534&amp;nbsp; &amp;nbsp; &amp;nbsp;00:00:00.714813&amp;nbsp; &amp;nbsp;00:08:21.257720&amp;nbsp; &amp;nbsp; &amp;nbsp;-00:00:00.006486&lt;br /&gt;RHF&amp;nbsp; &amp;nbsp; 00:08:21.281429&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 00:00:00.000014&lt;br /&gt;Skew&amp;nbsp; 1.000013 ;&amp;nbsp; &amp;nbsp;err -12993 ppb&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My HFXO runs at +2ppm and with time consuming k_uptime_get() measurement I got -15ppm for the LFXO&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you also think, that using Clock_skew sample gives correct values?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/thread/488305?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 11:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa9eeebe-1072-4639-8a30-80a12344078f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can measure the &lt;em&gt;average&lt;/em&gt; frequency of the crystal this way, but you will not be able to measure the jitter as what you are measuring here is the output of the GPIO toggeling, where you have digital logic, clock-crossing between the 32.768 kHz and the 16 MHz peripheral clock (derived from the high frequency clock source, whether&amp;nbsp;that is HFINT or HFXO), etc. Maybe you will get better results by starting the HFXO (see how it is done by&amp;nbsp;clock_init() in&amp;nbsp;nrf/samples/peripheral/radio_test/src/main.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/thread/488108?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2024 11:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53b82bfe-7e28-496b-87d5-d6b665367de5</guid><dc:creator>ChriglSEI</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you for your prompt replay.&lt;/p&gt;
&lt;p&gt;I allready tried the ppi sample earlier but I failed building it for nRF5340DK.&lt;/p&gt;
&lt;p&gt;Now with your files I was able to build and run it&amp;nbsp;&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;&lt;/p&gt;
&lt;p&gt;I have found the &lt;strong&gt;16.384kHz signal on Pin 5&lt;/strong&gt;&amp;nbsp;of a nRF5340DK;-)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On pin 4 was the 50ms alarm signal.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The problem now is, that the signal has a high jitter of around 200ns:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1718017946725v1.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;When I want to measure the accuracy of the LFXO I need to measure in sub-ns range.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;10ppm would be a difference 0.3ns.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have tried disabling&amp;nbsp;ppi_trace_pin_setup of COMPARE_EVT and STARTED_EVT but jitter stayed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have an idea what could lower jitter?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Measure LFXO 32.768 kHz on nRF5340</title><link>https://devzone.nordicsemi.com/thread/488031?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2024 07:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d013c918-ad1b-4ac5-b4f1-e9a3997fe74b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/samples/debug/ppi_trace/README.html#ppi-trace-sample"&gt;PPI trace sample&lt;/a&gt;. It does not include config files for the nrF5340 DK, but you can use these files:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2117.nrf5340dk_5F00_nrf5340_5F00_cpuapp.overlay"&gt;devzone.nordicsemi.com/.../2117.nrf5340dk_5F00_nrf5340_5F00_cpuapp.overlay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7888.nrf5340dk_5F00_nrf5340_5F00_cpuapp.conf"&gt;devzone.nordicsemi.com/.../7888.nrf5340dk_5F00_nrf5340_5F00_cpuapp.conf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drop them into&amp;nbsp;nrf/samples/debug/ppi_trace/boards. Then you can build for &lt;code&gt;nrf5340dk_nrf5340_cpuapp&lt;/code&gt;. With this pin 4 will toggle with half the frequency of the LF crystall, so if you measure that with a frequency counter or simlar and multipy it by two, you have the frequency of your LF clock source (regardless if this is an external crystal or the internal LFRC).&lt;/p&gt;
&lt;p&gt;If you are using a custom board, rename the conf-files above to your custom board name, and that should work as well (and adjust the pin configuration if needed).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>