<?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 Transition Issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52434/nrf52840-uart-transition-issues</link><description>We are having issues with UART communication on the nRF52840. Using a logic analyzer, we have found that the transitions happen too quickly. This causes the receiving MCU to read incorrect bits most of the time depending on where the transition lands</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Sep 2019 12:01:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52434/nrf52840-uart-transition-issues" /><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211799?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 12:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752d2d9b-e093-405c-b038-4c8cf8625919</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211703?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 08:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0e56220-278d-42fd-af9e-7fd9c8c6cf8d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, calling&amp;nbsp;nrf_drv_clock_hfclk_request() starts the 64 MHz oscillator, which uses the 32 MHz crystall.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211619?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 17:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57bd333f-4290-4ef9-90a8-1035f1fd7a38</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;Can you please tell me exactly which crystal/oscillator this selects on the schematic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211526?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 11:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ed2ac11-b7bb-4fde-aadf-d18ca09ade1a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I am glad to hear that worked. And thank you for the detailed update! Such updates can be very useful for others when looking for a solution to a similar problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211354?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 15:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5875a7bd-24ce-41b4-8ec5-f504dac770dd</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;OK, so we were finally able to select the XTAL as the clock source and everything works great.&amp;nbsp; The following code was added to the config file to accomplish this.&lt;/p&gt;
&lt;p&gt;#ifndef NRF_CLOCK_ENABLED&lt;/p&gt;
&lt;p&gt;#define NRF_CLOCK_ENABLED 1&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY&lt;/p&gt;
&lt;p&gt;#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#ifndef NRFX_CLOCK_CONFIG_LF_SRC&lt;/p&gt;
&lt;p&gt;#define NRFX_CLOCK_CONFIG_LF_SRC 1&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following code was added to the main file:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_drv_clock_init();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_drv_clock_hfclk_request(NULL);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211289?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 13:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dd8c8f2-5290-44cb-a34c-2a8c97fa9ab8</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;Thanks, we will try that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211273?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 13:02:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb5e0ca7-2da2-418b-aa3b-049d8aa7fa55</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Then it looks like you need a more accurate clock source on the nRF.&amp;nbsp;The cleanest approach would probably be to use the clock driver and call&amp;nbsp;nrf_drv_clock_hfclk_request().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211265?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20a75042-6a23-4c18-9f5e-94a0321e9f2d</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;On further investigation, it seems that the Nordic is running at 116504 baud even though we have it set to 115200.&amp;nbsp; The other MCU is running at 115163 baud.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211254?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fd8e0f4-477e-4e33-b9e6-5566e2b00a0d</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;We tried that but it seemed to make no difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211242?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:17:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:295bdcd5-d830-45fb-92f6-7150791d5d76</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Sounds like a bug in the other MCU - a UART should be sampling at the &lt;em&gt;&lt;strong&gt;centre&lt;/strong&gt; &lt;/em&gt;of the bit ...&lt;/p&gt;
&lt;p&gt;Are you doing a software (bit-banged) UART on the other MCU ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211239?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:14:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f088d3f7-f7b4-4d07-94a2-1dfbde296702</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;The problem seems that when going from example a 0 to a 1, the transition happens right on the boundary of when the other MCU is determining the value of the 0 bit position.&amp;nbsp; Sometimes, the other MCU recognizes the bit as a 0 and sometimes it recognizes it as a 1 because the value transitioned to the 1 a little early.&amp;nbsp; I have connected two of the other type of MCUs and they always work correctly. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211233?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:05:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9a15e10-ca14-45f6-b0b1-dcb602e0aa1d</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;It&amp;#39;s still not clear what, exactly, your problem is!&lt;/p&gt;
[quote userid="82088" url="~/f/nordic-q-a/52434/nrf52840-uart-transition-issues/211227"]the crystal oscillator[/quote]
&lt;p&gt;Which one - on the nRF, or on the other MCU.&lt;/p&gt;
&lt;p&gt;UART comms requires that &lt;em&gt;&lt;strong&gt;both&lt;/strong&gt;&lt;/em&gt; sides of the link have accurate clocks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211227?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 11:57:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae28579f-27f7-46f5-bf8f-5fe69c0464b4</guid><dc:creator>BAEE</dc:creator><description>&lt;p&gt;I also believe it may be that the clock drifts too much between devices.&amp;nbsp; However, unless we did something wrong, we attempted to select the crystal oscillator and it didn&amp;#39;t seem to help the problem.&amp;nbsp; Do you have some instructions for selecting the crystal oscillator?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211223?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 11:52:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bde06954-2f08-46cb-b4a7-c64f641df6c7</guid><dc:creator>awneil</dc:creator><description>[quote userid="82088" url="~/f/nordic-q-a/52434/nrf52840-uart-transition-issues"]the transitions happen too quickly[/quote]
&lt;p&gt;What do you mean by that?&lt;/p&gt;
&lt;p&gt;How about posting you LA screenshot to show what you mean?&lt;/p&gt;
&lt;p&gt;How do you know it&amp;#39;s the nRF being &amp;quot;too quick&amp;quot; - rather than other MCU being &amp;quot;too slow&amp;quot; ?&lt;/p&gt;
&lt;p&gt;Or a bit of both?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211212?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 11:30:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68d4e363-3e9a-4e0f-a9f3-1ec0e94c62a1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am having problems understanding how &amp;quot;transitions happen too quickly&amp;quot;, but it makes me think that you are talking about a situation where there are timing problems so that sampling happens too late, or similar? If so, I suspect one of two problems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you have not configured the same baud rate in both devices, or&lt;/li&gt;
&lt;li&gt;the clock drifts too much between the devices. For instance, you&amp;nbsp;should consider enabling the crystal oscillator, since the RC oscillator may not be accurate enough (at least with high baud rates).&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 UART Transition Issues</title><link>https://devzone.nordicsemi.com/thread/211044?ContentTypeID=1</link><pubDate>Sat, 21 Sep 2019 16:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4da33647-6b22-47eb-9b3c-daff2aa3ace1</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;try enabling pullups.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>