<?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>Trying to send something over UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66770/trying-to-send-something-over-uart</link><description>Hello, 
 I am trying to send something by my own via UARTE0. This is only for testing/learning purposes: 
 
 
 
 This is what I see: 
 [00:00:00.000,000] &amp;lt;info&amp;gt; app: enable(UART0)=8 [00:00:00.000,000] &amp;lt;info&amp;gt; app: pseltxd(UART0)=7 pselrxd(UART0)=-1 [00</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2020 12:35:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66770/trying-to-send-something-over-uart" /><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273493?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 12:35:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca5e71da-f728-40ad-80e4-1ba6e5658c54</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Found the problem with the second code, which is using UART0 (not UARTE0!):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_UART0-&amp;gt;BAUDRATE = (115200 &amp;lt;&amp;lt; UART_BAUDRATE_BAUDRATE_Pos); //WRONG!!!&lt;/pre&gt;&lt;/p&gt;
&lt;pre style="background-color:#ffffff;color:#080808;font-family:&amp;#39;JetBrains Mono&amp;#39;,monospace;font-size:9,8pt;"&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;must be&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_UART0-&amp;gt;BAUDRATE = 0x01D7E000;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;or &lt;br style="color:#1f542e;font-weight:bold;" /&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_UART0-&amp;gt;BAUDRATE = (UART_BAUDRATE_BAUDRATE_Baud115200 &amp;lt;&amp;lt; UART_BAUDRATE_BAUDRATE_Pos);&lt;/pre&gt;&lt;/p&gt;
&lt;pre style="background-color:#ffffff;color:#080808;font-family:&amp;#39;JetBrains Mono&amp;#39;,monospace;font-size:9,8pt;"&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273418?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 09:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d166e30e-a6ce-4bbd-9cb0-582c7db6887d</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Where can I find implementation of &lt;span style="color:#1f542e;font-weight:bold;"&gt;NRF_LOG_INFO,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;especially the version which sends something over UART in non-deferred mode?&lt;/p&gt;
&lt;p&gt;Does it enable something (clocks, power, ...) before sending some characters&lt;/p&gt;
&lt;p&gt;and switching it off, when everything was sent out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273293?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 14:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb9dfed7-3618-410a-9e51-9fb73b289d20</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;The final goal would be to have debug output via UART in secure dfu bootloader and still fit in size restrictions. It would be enough to send some characters or strings. Don&amp;#39;t need buffering of output. But I want to see which pathes are taken through bootloader or what error conditions occure. I need to see this via UART, because JTAG is not available widely. UART could be possible, if something is not working as planned. &lt;br /&gt;Note: The above tests were done in application code, just to learn how to deal with UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273272?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 14:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8a62e55-2cf9-45cc-92ff-a8b611b8bda6</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;I have my own hardware. It sends out data via TxD on pin 7.&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO is sent out, I see it. Also log output shows pseltxd(UART0)=7&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273266?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 13:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f44f738c-3c67-45da-a50c-f56cbeb581ac</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;The DK header files for PCA10040 and PCA10056 list the TXD pin as 6 and not 7. What hardware do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273262?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 13:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf01907-5fe3-4772-81e9-3b90b148afe7</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Whatever I try, UARTE0 or UART0, nothing is sent out by my code :-(&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NRF_LOG_INFO(&amp;quot;Just before while endless loop 4711&amp;quot;);

#define  UART_PIN_DISCONNECTED 0xFFFFFFFF /**&amp;lt; Value indicating that no pin is connected to this UART register. */

    NRF_UARTE0-&amp;gt;PSEL.TXD = UART_PIN_DISCONNECTED;
    NRF_UARTE0-&amp;gt;PSEL.RXD = UART_PIN_DISCONNECTED;

    {
        NRF_UART0-&amp;gt;ENABLE = 0;

        NRF_UART0-&amp;gt;PSELTXD = 7;
        NRF_UART0-&amp;gt;PSELRXD = 8;

        // Configure baud rate and parity.
        NRF_UART0-&amp;gt;BAUDRATE = (115200 &amp;lt;&amp;lt; UART_BAUDRATE_BAUDRATE_Pos);

        NRF_UART0-&amp;gt;CONFIG = (UART_CONFIG_PARITY_Excluded &amp;lt;&amp;lt; UART_CONFIG_PARITY_Pos);

        NRF_UART0-&amp;gt;ENABLE        = (UART_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; UART_ENABLE_ENABLE_Pos);
        NRF_UART0-&amp;gt;EVENTS_RXDRDY = 0;
        NRF_UART0-&amp;gt;EVENTS_TXDRDY = 0;

        NRF_UART0-&amp;gt;CONFIG       &amp;amp;= ~(UART_CONFIG_HWFC_Enabled &amp;lt;&amp;lt; UART_CONFIG_HWFC_Pos);

        NRF_UART0-&amp;gt;PSELRTS       = UART_PIN_DISCONNECTED;
        NRF_UART0-&amp;gt;PSELCTS       = UART_PIN_DISCONNECTED;

        NRF_UART0-&amp;gt;TASKS_STARTTX = 1;
        NRF_UART0-&amp;gt;TASKS_STARTRX = 1;

        // Enable UART interrupt
        NRF_UART0-&amp;gt;INTENCLR = 0xffffffffUL;

        NRF_UART0-&amp;gt;TXD = &amp;#39;A&amp;#39;;
        NRF_UART0-&amp;gt;TXD = &amp;#39;B&amp;#39;;
        NRF_UART0-&amp;gt;TXD = &amp;#39;C&amp;#39;;
    }

    while(1);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273170?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 09:38:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a13ff4cf-bee8-4ca8-a6b2-c6a058d69b06</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;I thought, when using NRF_LOG_INFO before and afterwards, and output is working,&lt;/p&gt;
&lt;p&gt;the pin, clock settings and baudrate is already ok for my code in between?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to send something over UART</title><link>https://devzone.nordicsemi.com/thread/273162?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 09:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c0da209-78e6-4a01-9748-126a1ed38611</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;You should see the UART waveform with an oscilloscope on P0.07.&lt;/p&gt;
&lt;p&gt;You want to set BAUDRATE register. If this is on an NRF DK, the &amp;quot;serial port&amp;quot; (in the Jlink chip) runs at 115200 Baud.&lt;/p&gt;
&lt;p&gt;You also mix NRF_UART0 and NRF_UARTE0 - the enable register is the same, but you really should always use NRF_UARTE0 instead.&lt;/p&gt;
&lt;p&gt;Also make sure that P0.07 is configured as &amp;quot;GPIO output&amp;quot; and set to HIGH. See Pin confiiguration in the UARTE chapter of PS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>