<?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>How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105906/how-to-enable-nrf52840-to-use-external-32mhz-crystal</link><description>Hi all, 
 I&amp;#39;m trying to get a UART connection running at 460800 bps, and it fails about 1-5% of the time, meaning that I receive less bytes than I expect. This happens a lot less when I set the speed down to 115200 bps. 
 I read on the datasheet that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jan 2025 10:55:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105906/how-to-enable-nrf52840-to-use-external-32mhz-crystal" /><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/517436?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 10:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f6f8850-1ff4-499a-a120-636e19ad71fb</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Check that your crystal is one of those mentioned in the PS. If its not, you will need to redesign the board to use one of them.&lt;/p&gt;
&lt;p&gt;HFXAL is picky about crystals due to the rather low turn-on time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/517344?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 23:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55622a8c-987d-4f8f-9a3c-8f872f91631c</guid><dc:creator>Albert_0</dc:creator><description>&lt;p&gt;Hi Nick,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, I don&amp;#39;t know what hardware you are using. I just copied over the code above from someone with a similar setup as mine and since it&amp;#39;s working, I didn&amp;#39;t look into it any more.&lt;/p&gt;
&lt;p&gt;Sorry I couldn&amp;#39;t be of more help.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Alberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/516225?ContentTypeID=1</link><pubDate>Tue, 24 Dec 2024 15:56:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d395431-1846-499f-8cf1-31bfdce74233</guid><dc:creator>nick yong</dc:creator><description>&lt;p&gt;&lt;span&gt;thanks. Alberto&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I use such code to set the extern Clock. but after run the code. I find the DK would run to right status. the extern clock is working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But, In my own designed board. the cystal chip is different from DK.&amp;nbsp; and after the code is run. I find the exten clock did not work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;HFCLKSTAT&amp;nbsp; src = 0. means it is using internal clock.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what can I check now?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/456821?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2023 07:21:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bc09b21-8452-4b47-b682-542dedee0d83</guid><dc:creator>Albert_0</dc:creator><description>&lt;p&gt;Hey &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/turboj"&gt;Turbo J&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your quick replies.&lt;/p&gt;
&lt;p&gt;I managed to turn on the External Clock with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* To strictly comply with UART timing, enable external XTAL oscillator */
void enable_xtal(void)
{
	struct onoff_manager *clk_mgr;
	static struct onoff_client cli = {};

	clk_mgr = z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
	sys_notify_init_spinwait(&amp;amp;cli.notify);
	(void)onoff_request(clk_mgr, &amp;amp;cli);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;inside my &amp;quot;main()&amp;quot;, and after checking the registers, it looks like all is set correctly.&lt;/p&gt;
&lt;p&gt;Unfortunately I cannot use the RTS/CTS lines due to the data coming from an external device over which we have no control. Not a big deal, it&amp;#39;s bursts of 33 bytes at 200Hz (5ms), and mostly into the micro.&lt;/p&gt;
&lt;p&gt;I checked the error registers, actually, I check them constantly after each burst of data reception, and there are no errors.&lt;/p&gt;
&lt;p&gt;Bottom line is, the serial interface with the active external crystal works very well and the data is received correctly. I am able to decode the stream as it&amp;#39;s coming in and the buffer changes ok.&lt;/p&gt;
&lt;p&gt;In terms of activating the clock, this has been resolved, thank you very much!&lt;/p&gt;
&lt;p&gt;I want to open a new thread regarding the reading of the UARTE buffers.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Alberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/456665?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 12:26:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f4140bd-6298-4a7b-836b-455e5227ef80</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can request the HFXO using the &amp;quot;onoff&amp;quot; API from the clock control subsystem as we do in&amp;nbsp;our&amp;nbsp;&lt;a class="reference internal" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/drivers/uart_nrf_sw_lpuart.html"&gt;Low power UART driver&lt;/a&gt;&amp;nbsp;here :&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/e2f09dbbc87e61b16aa18441748dafbfadc9b605/drivers/serial/uart_nrf_sw_lpuart.c#L378"&gt;https://github.com/nrfconnect/sdk-nrf/blob/e2f09dbbc87e61b16aa18441748dafbfadc9b605/drivers/serial/uart_nrf_sw_lpuart.c#L378&lt;/a&gt;. But as &lt;a href="https://devzone.nordicsemi.com/members/turboj"&gt;Turbo J&lt;/a&gt;&amp;nbsp; pointed out, the problem might simply be caused by the app being unable to keep up with the UART if flow control is not used.&lt;/p&gt;
&lt;p&gt;Cheers&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable NRF52840 to use external 32MHz crystal?</title><link>https://devzone.nordicsemi.com/thread/456637?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 10:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c209373d-5083-4c41-b390-bcf2db0e8a0e</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Do you use the flow controls signals (RTS/CTS)? High baud rates require those.&lt;/p&gt;
&lt;p&gt;Your lost characters might just be RX overflows, check if you can see the corresponding errors in the UART(E) errorsrc register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>