<?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>NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109365/nrf52840-uart-rx-received-data-incorrectly-when-use-hfint-internal-oscillator-as-clock-source</link><description>Hello, I am currently working on nrf52840 using nrf-sdk v2.2. to build a Matter firmware. I encountered an issue that a small number of chips UART received data incorrectly. I obtained the data waveform using an oscilloscope and did not find any abnormalities</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Apr 2024 09:04:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109365/nrf52840-uart-rx-received-data-incorrectly-when-use-hfint-internal-oscillator-as-clock-source" /><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479913?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 09:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48090bc8-6f22-438b-b680-42d1d54f50cc</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;&lt;span&gt;OK, thanks for help&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479912?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 09:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b3c5e2b-1adb-4efb-b93f-a08b1b8329c9</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;OK, thanks for help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479766?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 15:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caa09ebf-3052-4a44-8ca6-98a94c6e735c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Quite, at 9600 the frequency is unlikely to be an issue. Worth checking something else when waking from sleep; depending on the driver sometimes I see unexpected events incorrectly left enabled. In the case of EVENTS_CTS this is always set by hardware regardless of whether the HW flow control is ever used or not. Maybe capture these registers and print values:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Event:  CLOCK-&amp;gt;EVENTS_HFCLKSTARTED      0x4000&amp;#39;0100 = 1 (No Enable Field)       IntEnable 0x4000&amp;#39;0300=         0
Event:  CLOCK-&amp;gt;EVENTS_LFCLKSTARTED      0x4000&amp;#39;0104 = 1 (No Enable Field)       IntEnable 0x4000&amp;#39;0300=         0
Event:  POWER-&amp;gt;EVENTS_SLEEPENTER        0x4000&amp;#39;0114 = 1 (No Enable Field)       IntEnable 0x4000&amp;#39;0300=         0
Event:  UARTE-&amp;gt;EVENTS_CTS               0x4000&amp;#39;2100 = 1 Enable 0x4000&amp;#39;2500=0x00 IntEnable 0x4000&amp;#39;2300=         0, Shorts 0x4000&amp;#39;2200=0
Event:  UARTE-&amp;gt;EVENTS_TXDRDY            0x4000&amp;#39;211C = 1 Enable 0x4000&amp;#39;2500=0x00 IntEnable 0x4000&amp;#39;2300=         0, Shorts 0x4000&amp;#39;2200=0&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479741?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 13:58:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13f61fb3-fa26-415f-96cc-53f90849462f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Right, and for baud rate 9600,&amp;nbsp;the issue that hmolesworth mentioned is not relevant, so we don&amp;#39;t have anything to improve in this direction.&lt;/p&gt;
[quote user="Damon Liu"]The power I mentioned refers to the average&amp;nbsp;value over a period of time, so suspending the UART when it is not working will result in an average&amp;nbsp;value much less than 600uA and is acceptable.&amp;nbsp;&amp;nbsp;So what I need to do is switch HFINT to HFXO, so that UART can work properly. Do you think this method is feasible?[/quote]
&lt;p&gt;If the suspending then resuming strategy works for you, I think you should use it. Especially when it still satisfies your power requirement when HFXO is in used.&lt;/p&gt;
&lt;p&gt;Is this the answer you are looking for or did I misunderstand the question?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479574?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 02:09:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9607fede-0d24-4fe1-ae1f-0ad5927101bc</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;The baud rate is 9600 right now,&amp;nbsp;so&amp;nbsp;lower baud rate may not solve my problem.&amp;nbsp;The power I mentioned refers to the average&amp;nbsp;value over a period of time, so suspending the UART when it is not working will result in an average&amp;nbsp;value much less than 600uA and is acceptable.&amp;nbsp;&amp;nbsp;So what I need to do is switch HFINT to HFXO, so that UART can work properly. Do you think this method is feasible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479573?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 01:52:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4fa4a25-2374-40d6-94c1-ce12192df1ec</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;Thank you for your suggestion, but I observed an anomaly under the condition of a baud rate of 9600&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479449?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2024 13:01:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84ecd0fc-f7a1-4b71-96c0-aa69697445eb</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Right. The value used in the &lt;em&gt;UART&lt;/em&gt; documentation and drivers are not the best value. But&amp;nbsp;the ones used in the UARTE docs and drivers should be better.&lt;/p&gt;
&lt;p&gt;I believe hmolesworth discussed that in depth here:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43280/technical-question-regarding-uart-baud-rate-generator-baudrate-register-offset-0x524/169356"&gt;RE: Technical question regarding UART baud rate generator (BAUDRATE register, offset 0x524)&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/damon-liu"&gt;Damon Liu&lt;/a&gt;&amp;nbsp;How about lowering the baud rate? At lower baud rate, the lower accuracy of HFINT could be less impactful.&amp;nbsp;However, please note again that&amp;nbsp;this is not what the UART peripheral was designed to run with, so we cannot guarantee long term reliability.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479304?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 18:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36299fb3-be41-4f10-809a-3ea715330bb1</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;As an aside, what baud rate register value are you using? Probably have to set breakpoint and look at UART baudrate register to be sure, but you could also output register value in logging. Some baud rates were accurately calculated, some not; worth a check.&lt;/p&gt;
&lt;p&gt;HFINT works better with accurate setting; 961200 baud (used to) have the biggest error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/479302?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 18:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0c1c9a8-19e4-4177-8f22-8b8cd009182f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Damon, my apology for the late reply and for my misunderstanding. I forgot the&amp;nbsp;setup you already have.&lt;/p&gt;
&lt;p&gt;If you need lower than 600uA during UART active operation, I am afraid&amp;nbsp;it is not&amp;nbsp;really possible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s refer to &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/_tmp/nrf52840/autodita/CURRENT/parameters.i_timer.html?cp=5_0_0_4_1_0_8"&gt;the Current Consumption section of the Product Specification for TIMER&lt;/a&gt;. We can see that the current when HFXO is running is typically 646uA.&amp;nbsp;The majority of the consumption is from HFCLK running on external source, UART uses a little less current than TIMER, and thus 600uA is within expectation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/478183?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 06:31:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:728f88c8-4a46-4947-a1c0-231339012595</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;You mean 600uA? No, I don&amp;#39;t put UART to sleep this time. Because if I&amp;nbsp;put UART to sleep, I need to wake it up when data arrives, otherwise, UART can not receive the data.&amp;nbsp;That&amp;#39;s why I mentioned earlier about setting RX to the GPIO during UART sleep, so that when data arrives, UART can be awakened in the falling edge interrupt of GPIO.&amp;nbsp;This is what we talked about at the beginning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/477774?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 11:18:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27635fa9-cf2d-4325-9a4b-8dfec8224b0a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Have you tried to put UART to sleep? Refer to:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/101650/how-to-put-the-uart-to-sleep-low-power-mode"&gt;How to put the UART to sleep (low power mode)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/477690?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 02:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57049453-2317-4fce-84f5-b925ae76415e</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;Sorry for the late reply, I have recently tested this issue. I tried to keep UART alive and test the power consumption of nrf52840, the result is above 600uA, which cannot meet our requirement of low power.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/474583?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2024 11:47:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:594fa648-86d9-47f6-a650-a707542638b5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Damon,&lt;/p&gt;
&lt;p&gt;Great, please feel free to let me know if you have any related questions &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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/474476?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2024 05:03:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0958574e-f112-4597-982c-fd5d4b17a873</guid><dc:creator>Damon Liu</dc:creator><description>&lt;p&gt;Hi Hier,&lt;/p&gt;
&lt;p&gt;Thank you for answering my questions. I will try not to duplicate the configuration of Rx and verify if the power consumption meets our product requirements&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 UART Rx received data incorrectly when use HFINT internal oscillator as clock source</title><link>https://devzone.nordicsemi.com/thread/474280?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2024 10:49:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab496ff1-9e6f-4386-82ab-3512dab2b196</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Damon,&lt;/p&gt;
&lt;p&gt;As you have found, on the nRF52840, HFINT is not sufficient for the UART peripheral to work accurately. This is note in &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uart.html?cp=5_0_0_5_32"&gt;the Product Specification&lt;/a&gt;:&lt;/p&gt;
[quote]Note: The external crystal oscillator must be enabled to obtain sufficient clock accuracy for stable communication. See CLOCK — Clock control for more information.[/quote]
&lt;p&gt;&lt;/p&gt;
[quote user=""]Due to the low power consumption requirements of the product. UART enters &amp;quot;sleep&amp;quot;&amp;nbsp;&lt;span&gt;when it is not in use&lt;/span&gt;, the&amp;nbsp;RX turns to GPIO mode.&amp;nbsp;When data comming, RX generates a falling edge (UART start bit), triggering a GPIO falling edge interrupt. In interrupt processing, UART will be enabled again.&amp;nbsp;This process is called &amp;quot;wakeup&amp;quot;.&amp;nbsp;This issue occurs during the initial wake-up period of UART, and then returns to normal until UART goes back to sleep.[/quote]
&lt;p&gt;On the topic of UART clock,&amp;nbsp;I think&amp;nbsp;when the UART work, it is only thanks to a relatively low baud rate. If you use high baud rate, you will start to see more issues.&lt;/p&gt;
&lt;p&gt;This is not the topic of discussion, but in the nRF Connect SDK, the OS should by default put the device into an idle low power mode, where UART activity can be maintain without the need to reconfigure UART RX pin like you are describing. Is this not enough?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>