<?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>External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65805/external-32khz-crystal-detection</link><description>Hi, 
 
 In my current project I have two type of boards. Some have the external 32kHz crystal mounted and some not. 
 I am trying to detect the presence of the external crystal by trying to start it and checking EVENTS_LFCLKSTARTED and LFCLKSTAT. 
 My</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Oct 2020 07:20:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65805/external-32khz-crystal-detection" /><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/275491?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 07:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1482686-ee30-4ab1-b34e-a406d2eed168</guid><dc:creator>awneil</dc:creator><description>[quote userid="93391" url="~/f/nordic-q-a/65805/external-32khz-crystal-detection/275482#275482"] I think you can close the ticket now[/quote]
&lt;p&gt;You do that with the &amp;#39;Verify Answer&amp;#39; button:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4300._5F00_Verify_2D00_answer_2D00_nordic_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/275482?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 06:34:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05291ce7-8b21-44ec-b2ce-9766d9ca59af</guid><dc:creator>Vincent G.</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the explanation. I think you can close the ticket now.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/275414?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 15:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b768791-9eb2-4e12-807c-e31fa3aa4886</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We suspect that the&amp;nbsp;&lt;span&gt;noise injection&amp;nbsp;&lt;/span&gt;on XL1(P0.00) and/or XL2(P0.01) could&amp;nbsp;be enough&amp;nbsp;to trigger the event EVENTS_LFCLKSTARTED, and be&amp;nbsp;&lt;span&gt;propagated to the clock output even if no crystal is mounted, and even if XL1/XL2 is grounded. The clock&amp;nbsp;oscillator was not designed&amp;nbsp;for this use-case. The behavior might vary from chip-to-chip, and seems&amp;nbsp;to also depend on the noise level on VDD.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/274211?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 07:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6439112a-00e1-48e2-8091-b2163dbf995c</guid><dc:creator>Vincent G.</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thanks for the workaround.&lt;/p&gt;
&lt;p&gt;Keep me posted if you get any info about the issue from your team.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/273462?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 11:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:535cd812-2dbf-4dc1-9efc-53aa5d1c0822</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Vincent G."]Did you get any answers from your team ?[/quote]
&lt;p&gt;The team has not seen this issue before. We are investigating the issue.&lt;/p&gt;
[quote user=""]But waiting more that 250µS doesn&amp;#39;t seem to be a reliable way to detect the absence of crystal.[/quote]
&lt;p&gt;We are still looking into this, but as a workaround to detect whether a crystal is mounted, we might suggest something like this:&lt;/p&gt;
&lt;p&gt;If LFCLKSTARTED event has not come after 1 second, conclude that no crystal is connected&lt;br /&gt;If LFCLKSTARTED event has come within 1 second, measure LFCLK frequency &lt;br /&gt;If LFCLK frequency is not &amp;quot;close&amp;quot; to 32768Hz then conclude that no crystal is connected&lt;/p&gt;
&lt;p&gt;The 1 second wait may be shortened, but it depends on the crystal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/272419?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 07:05:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3b42089-6d78-44c1-8fb8-516c0076b93b</guid><dc:creator>Vincent G.</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Did you get any answers from your team ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/270142?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2020 14:40:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0281ad1a-6b8f-4911-a21e-d5e89b91957e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was able to reproduce this on a different nRF52832 DK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will check with the team if they have seen this before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/269874?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 12:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:876d0c05-c636-4a75-b3b4-b3c306afb903</guid><dc:creator>Vincent G.</dc:creator><description>&lt;p&gt;I tested this on two other pca10040 and I can reproduce on both of them.&lt;/p&gt;
&lt;p&gt;Marking on NRF52 is nrf52QFAAB0. Maybe you tested on an earlier revision?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/269672?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 13:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0827bd8b-0c49-4520-a7e5-25bf2ecb8772</guid><dc:creator>Vincent G.</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have just tested your fix and it doesn&amp;#39;t change anything.&lt;/p&gt;
&lt;p&gt;My code :&lt;/p&gt;
&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#6a9955;"&gt;/*&amp;nbsp;Start&amp;nbsp;LFCLK&amp;nbsp;with&amp;nbsp;external&amp;nbsp;32kHz&amp;nbsp;XTAL&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_CLOCK&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;EVENTS_LFCLKSTARTED&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_CLOCK&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;LFCLKSRC&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;(CLOCK_LFCLKSRC_SRC_Xtal&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;CLOCK_LFCLKSRC_SRC_Pos);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;__DSB&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nrfx_clock_anomaly_132&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_CLOCK&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;TASKS_LFCLKSTART&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;1&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;__DSB&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color:#c586c0;"&gt;while&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;NRF_CLOCK&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;EVENTS_LFCLKSTARTED&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;==&amp;nbsp;&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If I hit the reset button on a board without 32kHz crystal it boot in approx. seconds.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also I have noticed something on boards with a crystal :&lt;/p&gt;
&lt;p&gt;Just after flashing, crystal startup time takes more than 250ms, between 380ms and 500ms. After reset the 32kHz crystal start in 250ms. Is this something expected ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Vincent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External 32kHz crystal detection</title><link>https://devzone.nordicsemi.com/thread/269373?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 12:36:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf425f83-eb07-46e9-adae-f8d7f3e31752</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was not able to reproduce this on a nRF52832DK without LF crystal.&lt;/p&gt;
&lt;p&gt;But, could you try to add this &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.4/drivers/src/nrfx_clock.c#L124"&gt;errata 132 delay&lt;/a&gt;, before starting the LFCK, and see if it fixes the issue? Similar to how it&amp;#39;s done &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.4/drivers/src/nrfx_clock.c#L228"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>