<?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>Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103830/adding-uart1-to-a-project</link><description>Hi, 
 I have a project which uses nRF Logging module (NRF_LOG_INFO). I suppose by default it uses UART0. I have a peripheral that requires to use another serial port (UART1). The UART library (APP_UART_FIFO_INIT) does not give any provision to select</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Oct 2023 07:01:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103830/adding-uart1-to-a-project" /><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/448440?ContentTypeID=1</link><pubDate>Mon, 02 Oct 2023 07:01:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd48dd8-10d6-472b-8036-a3d8c4656afa</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Hi, for now I have included the &amp;#39;0&amp;#39; start code in the dmx_data[] array and it works for me (not sending &amp;#39;0&amp;#39; separately now). But it&amp;#39;s very strange for me. Also the same code works in the uart example in the SDK, infact I tested the code in the &amp;#39;uart&amp;#39; example first and then included it into my main project. I had also tried direct register write method previously, dropped for some reason. I&amp;#39;ll look into it again. Thanks for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/448382?ContentTypeID=1</link><pubDate>Fri, 29 Sep 2023 15:04:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee247b7-5899-471a-8ea7-71caac29f89b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I can&amp;#39;t see any reasons that the app_uart code should prevent the sending of 0/NULL.&lt;/p&gt;
&lt;p&gt;Since you are already mixing direct register access with app_uart, could you try to simply use registers only to send the data? See for instance &lt;a href="https://github.com/andenore/NordicSnippets/blob/master/examples/uart/main.c"&gt;this example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/447947?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2023 12:32:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ba5f071-c77f-4497-90b0-3b51ca015971</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;No error code is returned, it compiles and executes but this data is not sent.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Its defined like: #3define DMX_START_CODE 0x00&lt;/p&gt;
&lt;p&gt;However, I have tried sending 0 directly like:&amp;nbsp;while (app_uart_put(0) != NRF_SUCCESS);&lt;/p&gt;
&lt;p&gt;Also tried to use a variable. In all cases same result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/447945?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2023 12:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39854b1e-066d-4f76-90cb-64ee2255b1dd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Can you post your full code?&lt;/p&gt;
&lt;p&gt;How&amp;nbsp;is&amp;nbsp;DMX_START_CODE defined?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the error code returned from the call to&amp;nbsp;app_uart_put() on line 10?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/447196?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2023 08:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd942041-ac6d-4b86-9c35-08da9610bfc1</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;OK, I got close to the issue. If I comment out line#10 in above code, the code works fine. However, omitting sending the 0 at start violates the DMX protocol, it has to be sent. I tried adding delay after line#7 but it does not resolve the issue. Any clues? &lt;a href="https://devzone.nordicsemi.com/members/joh2"&gt;Jørgen Holmefjord&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/446899?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 13:32:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7585a9fd-4433-4160-ad45-536ddc9f6e83</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;I have to make a few changes to use it for DMX for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Configure 2 stop bits
NRF_UARTE1-&amp;gt;CONFIG = (1U &amp;lt;&amp;lt; UARTE_CONFIG_STOP_Pos);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Create start sequence with modified baud rate
    NRF_UARTE1-&amp;gt;BAUDRATE = (UARTE_BAUDRATE_BAUDRATE_Baud57600 &amp;lt;&amp;lt; UARTE_BAUDRATE_BAUDRATE_Pos);
    while (app_uart_put(0) != NRF_SUCCESS);
    nrf_delay_us(191);

    // Change the baud rate back to 250k
    NRF_UARTE1-&amp;gt;BAUDRATE = (UARTE_BAUDRATE_BAUDRATE_Baud250000 &amp;lt;&amp;lt; UARTE_BAUDRATE_BAUDRATE_Pos);

    // Send Start Code
    while (app_uart_put(DMX_START_CODE) != NRF_SUCCESS);

    // Send DMX channel data
    for (int i = 0; i &amp;lt; DMX_CHANNEL_COUNT; i++)
    {
        while (app_uart_put(dmx_data[i]) != NRF_SUCCESS);
    }

    // Send Inter-Frame Gap (IFG)
    nrf_delay_us(16); // Two Mark Time periods (approximately)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I cannot see any data on logic analyzer. If I use UART0 with app_uart (UART instead of UARTE and NRF_UART0 instead of NRF_UARTE1 in above code), everything works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding UART1 to a Project</title><link>https://devzone.nordicsemi.com/thread/446447?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 11:59:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44451568-ef83-4f0f-820a-196b8bec2967</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can change the UART instance used by APP_UART library by changing&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__app__uart__config.html#ga8d87d78b9385caa4b6747aa61cc85c9f"&gt;APP_UART_DRIVER_INSTANCE&lt;/a&gt;&amp;nbsp;in your sdk_config.h file. The UART instance used by the logger module is hardcoded to UARTE0 in the module code. APP_UART does not support multi-instance and can one be used with one UART at a time. The logger module uses the nrf_drv_uart API directly, so this does not interfere with the APP_UART module.&lt;/p&gt;
&lt;p&gt;In later SDK versions, we also provide a new library:&amp;nbsp;&lt;a title="Libuarte - advanced UARTE driver" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_libuarte.html?cp=9_1_3_28"&gt;Libuarte - advanced UARTE driver&lt;/a&gt;, which supports multi-instance, RX timeout, and many other features.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>