<?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 baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79977/uart-baudrate-is-inaccurate</link><description>Hello 
 The Uart Baudrate is initiliazed at 115200 baud but i the BLE nRF52833 is sending with about 115900. 
 I try to switch to hf clock but the baudrate is to high. 
 // Request and wait for it to be ready. err_code = sd_clock_hfclk_request(); APP_ERROR_CHECK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Oct 2021 10:57:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79977/uart-baudrate-is-inaccurate" /><item><title>RE: Uart baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/thread/333705?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 10:57:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1ad817b-7fce-41bb-93dd-6f0538751f86</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Ralf,&lt;br /&gt;&lt;br /&gt;You are working on a custom board right? And are you seing this error on all boards or just one?&lt;/p&gt;
&lt;p&gt;In my previous answer I ment the carrier frequency accuracy. We measure the crystal accuracy by setting up a single TX carrier on the radio to then verify if the TX carrier is outside the accepted range. This is explained in the &lt;a href="https://infocenter.nordicsemi.com/pdf/nwp_006.pdf?cp=17_18#G1001151"&gt;RF performance test and guidelines whitepaper&lt;/a&gt;. If working on a custom board you need to check the frequency accuracy and tune the crystal capacitors values accordingly.&lt;/p&gt;
&lt;p&gt;If the TX carrier frequency is outside of the accepted window there are two issues you should check:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Crystal accuracy specification.&lt;/li&gt;
&lt;li&gt;Crystal load.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So check the datasheet of the crystal you are using, check that it complies with the crystal specifications available in the nRF52833 product specification. Then check the crystals&amp;#39; load capacitance (C&lt;sub&gt;L&lt;/sub&gt;) in the crystal datasheet. The load capacitance should be choose accordingly to this value and the formula: &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;C1 = C2 = 2C&lt;sub&gt;L&lt;/sub&gt; - C_pcb - C_pin&lt;/p&gt;
&lt;p&gt;Cl: Load capacitance of the crystal (found in the crystal datasheet)&lt;/p&gt;
&lt;p&gt;C_pcb + C_pin is approximately 4 pF.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But these values should be adjusted depending on what you see on the scope when measuring the frequency accuracy. &lt;/p&gt;
&lt;p&gt;Let me know if my assumptions are perhaps incorrect. If you are for example testing on a nRF52833 DK the problem will not be on the hardware but probably on the software side...&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/thread/333577?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 15:09:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38e3bb84-b37a-4590-868c-441a9243a726</guid><dc:creator>RSchmale</dc:creator><description>&lt;p&gt;&lt;img class="align-right" style="float:right;" alt="Quartz und 5,5ppm" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Quartzppm.jpg" /&gt;Hello Marjeris&lt;/p&gt;
&lt;p&gt;As you can see the ppm margin is at 5.5ppm&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/thread/332860?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 13:35:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db0e99fd-7b60-4264-a977-af266c58ee93</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="RSchmale"]yes, we checked the external crystal and the cyrstal is accurate.[/quote]
&lt;p&gt;Do you have a scope capture? Did you check that the requirements for crystal accuracy was inside of the recommended &amp;lt;40 ppm margin?&lt;/p&gt;
[quote user="RSchmale"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how can I stop the LFCLK and start/release the HFCLK.&lt;/p&gt;[/quote]
&lt;p&gt;You should call nrf_drv_clock_hfclk_request() to request the clock to start. If the clock is not running nrf_drv_clock_hfclk_is_running should return &amp;#39;false&amp;#39; when called.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="RSchmale"]&amp;nbsp; // nrf_drv_clock_hfclk_release(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;strong&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;this raises an error if implented&lt;/strong&gt;[/quote]
&lt;p&gt;This call will stop the clock if it&amp;#39;s running. If you are getting an error from it it could be that the clock is not started.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/thread/331839?ContentTypeID=1</link><pubDate>Thu, 30 Sep 2021 07:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43aa0fea-2341-463e-83fa-d4d1d14093bc</guid><dc:creator>RSchmale</dc:creator><description>&lt;p&gt;yes, we checked the external crystal and the cyrstal is accurate.&lt;/p&gt;
&lt;p&gt;this is defined in sdk_config.h&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;e&amp;gt; NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;//==========================================================&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#ifndef NRFX_CLOCK_ENABLED&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#define NRFX_CLOCK_ENABLED 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;o&amp;gt; NRFX_CLOCK_CONFIG_LF_SRC&amp;nbsp; - LF Clock Source&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;0=&amp;gt; RC &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;1=&amp;gt; XTAL &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;2=&amp;gt; Synth &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;131073=&amp;gt; External Low Swing &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;// &amp;lt;196609=&amp;gt; External Full Swing &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#ifndef NRFX_CLOCK_CONFIG_LF_SRC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#define NRFX_CLOCK_CONFIG_LF_SRC 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;#endif&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;after swithed on the hf clock (see above ) both are running&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( nrf_drv_clock_hfclk_is_running() )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Start execution.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; // nrf_drv_clock_hfclk_release(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;strong&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt;this raises an error if implented&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;HFCLK running&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( nrf_drv_clock_lfclk_is_running() ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;LFCLK running&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;how can I stop the LFCLK and start/release the HFCLK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Uart baudrate is inaccurate</title><link>https://devzone.nordicsemi.com/thread/331450?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 08:54:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba072c3b-c73b-4a66-aee6-5eca54b1913b</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. How are you measuring the uart baudrate? Is this happening on a nRF52833 DK or a custom board? Have you check the accuracy of the external crystal and tuned the crystal capacitors?&lt;br /&gt;&lt;br /&gt;Is the baudrate still too high if you are using the internal oscillator? It may be that the external crystal capacitors are not tuned correctly so it&amp;#39;s oscillating too fast.&lt;br /&gt;&lt;br /&gt;Baudrate accuracy depends both on accuracy of the clock source (HFXO or HFINT) and division error in the baudrate generator. Actual baudrates when accounting for division errors are listed here: &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52833%2Fuarte.html&amp;amp;anchor=register.BAUDRATE"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52833%2Fuarte.html&amp;amp;anchor=register.BAUDRATE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>