<?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>How to add RS‑485 DE pin control to console/shell UART on nRF52840?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126792/how-to-add-rs-485-de-pin-control-to-console-shell-uart-on-nrf52840</link><description>Hello, 
 On my board I implemented an RS-485 interface using the ST4E1216IDT transceiver. The DE (Driver Enable) and RE (Receiver Enable) pins are tied together and connected to a pin (de pin) of the nRF52840, in order to act as a tx data enable pin.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Mar 2026 07:56:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126792/how-to-add-rs-485-de-pin-control-to-console-shell-uart-on-nrf52840" /><item><title>RE: How to add RS‑485 DE pin control to console/shell UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/562994?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2026 07:56:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48a55efc-ffa5-4116-ac9f-593c88a6042a</guid><dc:creator>mbakker</dc:creator><description>&lt;p&gt;I had the same problem and managed to solve it using the PPI (DPPI on nRF54L).&lt;br /&gt;Simply connect the UARTE TX_READY to the SUBSCRIBE_SET and the TX_END to SUBSCRIBE_CLR of an unused GPIOTE instance.&lt;br /&gt;No need for any changes in the DT or drivers.&lt;br /&gt;&lt;br /&gt;Here&amp;#39;s how I achieved it on the nRF54L, it should not be difficult to port to the nRF52:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int enable_uart_de(void)
{
    // Assert P1.02/UART_DE when transmitting on UARTE21

    NRF_UARTE21-&amp;gt;PUBLISH_DMA.TX.READY = (1 &amp;lt;&amp;lt; UARTE_PUBLISH_DMA_TX_READY_CHIDX_Pos) |
                                        (UARTE_PUBLISH_DMA_TX_READY_EN_Enabled &amp;lt;&amp;lt; UARTE_PUBLISH_DMA_TX_READY_EN_Pos);
    NRF_UARTE21-&amp;gt;PUBLISH_DMA.TX.END   = (2 &amp;lt;&amp;lt; UARTE_PUBLISH_DMA_TX_END_CHIDX_Pos) |
                                        (UARTE_PUBLISH_DMA_TX_END_EN_Enabled   &amp;lt;&amp;lt; UARTE_PUBLISH_DMA_TX_END_EN_Pos);

    NRF_GPIOTE20-&amp;gt;SUBSCRIBE_SET[5] = (1 &amp;lt;&amp;lt; GPIOTE_SUBSCRIBE_SET_CHIDX_Pos) |
                                     (GPIOTE_SUBSCRIBE_SET_EN_Enabled &amp;lt;&amp;lt; GPIOTE_SUBSCRIBE_SET_EN_Pos);
    NRF_GPIOTE20-&amp;gt;SUBSCRIBE_CLR[5] = (2 &amp;lt;&amp;lt; GPIOTE_SUBSCRIBE_CLR_CHIDX_Pos) |
                                     (GPIOTE_SUBSCRIBE_CLR_EN_Enabled &amp;lt;&amp;lt; GPIOTE_SUBSCRIBE_CLR_EN_Pos);
    NRF_GPIOTE20-&amp;gt;CONFIG[5]        = (GPIOTE_CONFIG_MODE_Task   &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos)|
                                     (GPIOTE_CONFIG_OUTINIT_Low &amp;lt;&amp;lt; GPIOTE_CONFIG_OUTINIT_Pos) |
                                     (2 &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos) |
                                     (1 &amp;lt;&amp;lt; GPIOTE_CONFIG_PORT_Pos);

    NRF_DPPIC20-&amp;gt;CHENSET = (DPPIC_CHENSET_CH1_Enabled &amp;lt;&amp;lt; DPPIC_CHENSET_CH1_Pos);
    NRF_DPPIC20-&amp;gt;CHENSET = (DPPIC_CHENSET_CH2_Enabled &amp;lt;&amp;lt; DPPIC_CHENSET_CH2_Pos);
    
    return 0;
}

SYS_INIT(enable_uart_de, EARLY, 20);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add RS‑485 DE pin control to console/shell UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/561438?ContentTypeID=1</link><pubDate>Wed, 18 Feb 2026 08:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b3d975-ff8f-4cb1-a81a-32642cdf0a87</guid><dc:creator>Avgerinos Bakalidis</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried your suggestion of using an RS-485 with auto direction capability and it worked.&lt;/p&gt;
&lt;p&gt;More specifically I used the&amp;nbsp;THVD1426DR (RS-485 Transceivers with Auto-direction Control) from Texas instruments and found out that the Zephyr shell is working as well as the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.4.2/page/zephyr/services/device_mgmt/mcumgr.html"&gt;MCUmgr&lt;/a&gt; on downloading a file with no issues, through the RS-485 half duplex connection.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp; for your suggestion!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add RS‑485 DE pin control to console/shell UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/560131?ContentTypeID=1</link><pubDate>Mon, 02 Feb 2026 13:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e16fd3ea-356c-4126-b044-c0d8d358ec59</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You cannot make console/shell toggle the DE pin with nRF52840 without changes to the uarte driver and possible the dts property of the uarte. Maybe you can use an rs-485 with auto direction capability so that the uart part remains the same as what nordic chips can support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add RS‑485 DE pin control to console/shell UART on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/560035?ContentTypeID=1</link><pubDate>Fri, 30 Jan 2026 16:20:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a02f99d-fe28-4cc3-874b-89efe32295ae</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;You cant use UART shell directly here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But there is also the dummy shell backend. Mcumgr subsystem uses that to tunnel shell commands over the mucmgr (smp) protocol - you may be able to do something roughly similar with your rs485 operations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>