<?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>UART clock accuracy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118072/uart-clock-accuracy</link><description>Hi, 
 Setup: 
 nRF NCS 1.9.x and nRF NCS 2.5.0 
 nRF5340 and nRF52840 both with an external crystal attached to HF clock input. 
 Problem: 
 Inaccuracy in timing of UART at baud 115200, seems like the 2X nRF chips in my setup have difficulty talking to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jan 2025 20:27:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118072/uart-clock-accuracy" /><item><title>RE: UART clock accuracy</title><link>https://devzone.nordicsemi.com/thread/518729?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 20:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e5c2b60-ba2d-4438-8022-4a73c6bb2f90</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Inaccuracy in timing of UART at baud 115200, seems like the 2X nRF chips in my setup have difficulty talking to one another as the temperature rises. The suspicion being that the internal clock (HF) varies enough in timing and that causes enough delta that makes the bits uninterpretable for the receiver. I am reading that baud 115200 requires timing within +-2%. I can see through scope captures that the duty cycle of each bit does vary more than that at high temp. So hence the suspicion.[/quote]
&lt;p&gt;Correct. You need to enable HFXO,&amp;nbsp;as mentioned in&amp;nbsp;the UARTE chatper for &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/uarte.html"&gt;nRF52840&lt;/a&gt; and &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/uarte.html"&gt;nRF5340&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1737058932170v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]I see some examples that directly call into clock management API (at_client sample of nRF9160), but that then requires manually calling to enable the external clock, then do I have to shut it down manually also? Doesn&amp;#39;t sound very elegant and Zephyr&amp;#39;y. But if this is the only way, any further guidance would be appreciated.[/quote]
&lt;p&gt;As of today the application would need to request the HFXO itself. See how it&amp;#39;s done with e.g. this function:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/applications/serial_lte_modem/src/main.c#L97"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/applications/serial_lte_modem/src/main.c#L97&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>