<?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 on Custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42629/uart-on-custom-board</link><description>Hi there, 
 I am trying to use UART on the nRF52840 on a custom PCB. The custom board is connected to the nRF52840-DK with a debug connector. Am I free to set any pins on the chip as the RX, TX, etc? I was just going to use a scope to see if data is going</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Jan 2019 02:26:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42629/uart-on-custom-board" /><item><title>RE: UART on Custom board</title><link>https://devzone.nordicsemi.com/thread/166386?ContentTypeID=1</link><pubDate>Fri, 18 Jan 2019 02:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83893d86-a10a-4a7c-913a-f559f0ef209f</guid><dc:creator>graceling</dc:creator><description>&lt;p&gt;Thanks for this!&lt;/p&gt;
&lt;p&gt;I am trying to use a sensor that needs 9600 baud rate, and that&amp;#39;s what I set it to on the sdk_config.h. Would I still be able to see the transmit/receive data on putty if the baud rate is set to 9600 and the DK runs on 115200? At the moment, I can only see things on putty if the baud rate is set to 115200.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having trouble with getting any responses from the sensor, both from the custom PCB and just connecting the sensor to the assigned GPIO pins on the DK. I am able to send commands to the sensor ie &amp;quot;Z\r\n&amp;quot; but I am not getting the right response back from the sensor. In this case, the temperature reading.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART on Custom board</title><link>https://devzone.nordicsemi.com/thread/166143?ContentTypeID=1</link><pubDate>Thu, 17 Jan 2019 08:23:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3372230a-9fc8-4795-8376-68463825616c</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You can use any free GPIO pin as TX or RX for UART, list of GPIO pins is &lt;a href="https://www.nordicsemi.com/DocLib/Content/Product_Spec/nRF52840/latest/pin?1066#pin_assign"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]ETA: It seems like I&amp;#39;ve set up the PSEL registers fine. I&amp;#39;ve set the Baudrate to 115200 but looking at the registers, it says the baud rate is 2576384 ??? There is also an event error but I&amp;#39;m not specifically what the error is.[/quote]
&lt;p&gt;&amp;nbsp;Have you set the baudrate in &lt;strong&gt;sdk_config.h&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;They are defined in &lt;strong&gt;sdk_config.h&lt;/strong&gt; as the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;323584=&amp;gt; 1200 baud 
// &amp;lt;643072=&amp;gt; 2400 baud 
// &amp;lt;1290240=&amp;gt; 4800 baud 
// &amp;lt;2576384=&amp;gt; 9600 baud 
// &amp;lt;3866624=&amp;gt; 14400 baud 
// &amp;lt;5152768=&amp;gt; 19200 baud 
// &amp;lt;7729152=&amp;gt; 28800 baud 
// &amp;lt;8388608=&amp;gt; 31250 baud 
// &amp;lt;10309632=&amp;gt; 38400 baud 
// &amp;lt;15007744=&amp;gt; 56000 baud 
// &amp;lt;15462400=&amp;gt; 57600 baud 
// &amp;lt;20615168=&amp;gt; 76800 baud 
// &amp;lt;30924800=&amp;gt; 115200 baud 
// &amp;lt;61845504=&amp;gt; 230400 baud 
// &amp;lt;67108864=&amp;gt; 250000 baud 
// &amp;lt;123695104=&amp;gt; 460800 baud 
// &amp;lt;247386112=&amp;gt; 921600 baud 
// &amp;lt;268435456=&amp;gt; 1000000 baud &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So if you want the baudrate equal to 115200, you have to define it like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE
#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you use the &lt;strong&gt;nrfx&lt;/strong&gt; &lt;strong&gt;UART&lt;/strong&gt; driver, if you use the &lt;strong&gt;UART&lt;/strong&gt; library, define the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef UART_DEFAULT_CONFIG_BAUDRATE
#define UART_DEFAULT_CONFIG_BAUDRATE 30801920
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>