<?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>nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53906/nrf9160-multiplex-uart-and-other-peripherals</link><description>Hi, 
 We are using ncs 1.0.0 and modem fw version 1.0.1. 
 We are currently using 2 UART, 1 SPI and 1 I2C peripheral in our application. 
 We want to use one more UART in our application. 
 SPI and I2C peripherals are not frequently needed to be used</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Nov 2019 10:00:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53906/nrf9160-multiplex-uart-and-other-peripherals" /><item><title>RE: nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/thread/219235?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 10:00:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:111ba350-2305-4e95-8440-8b4df0d315f7</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;You can&amp;#39;t initialize or uninitialize peripherals at runtime. And since I2C3 and UART3 share the same resources, you will have to do what I suggested in my previous reply, by writing to the registers directly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Disable I2C3 by first making sure to stop RX / TX and wait for any events and then writing to the ENABLE register. The enable UART3 by doing the exact opposite of what you would to disable it (write to the ENABLE register, then start RX / TX).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/thread/219196?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 03:32:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae33a6c5-2b7e-4d0c-af01-0e38edb31c7e</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We can disable the UART/SPI/I2C this way but is it possible to initialize new peripheral ?&lt;/p&gt;
&lt;p&gt;For example ,&lt;/p&gt;
&lt;p&gt;I am using UART0 and UART1,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using SPI2 and I2C3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now i want to disable I2C3 at runtime and initialize UART3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it possible to do it ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/thread/219096?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 14:24:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:137650f2-4ef8-439f-8534-3dc49db0d313</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Yes, this should definitely be possible!&lt;/p&gt;
&lt;p&gt;You have to stop the RX / TX, as per the datasheet (wait for events and so forth) and then disable&amp;nbsp;the peripheral. And for enabling do the exact same, just in reverse.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Take a look at the API reference for &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/i2c.html"&gt;I2C&lt;/a&gt; and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/uart.html"&gt;UART&lt;/a&gt;&amp;nbsp;to see how to enable/disable the peripherals.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/52496/nrf9160-uart-pull-up-and-power-consumption/216096#216096"&gt;This answer&lt;/a&gt;&amp;nbsp;from Håkon also shows how to disable the UART peripheral:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_UARTE1-&amp;gt;TASKS_STOPRX=1;
while(NRF_UARTE1-&amp;gt;EVENTS_RXTO == 0);
NRF_UARTE1-&amp;gt;EVENTS_RXTO = 0;
NRF_UARTE1-&amp;gt;TASKS_STOPTX = 1;
while(NRF_UARTE1-&amp;gt;EVENTS_TXSTOPPED == 0);
NRF_UARTE1-&amp;gt;EVENTS_TXSTOPPED = 0;
NRF_UARTE1-&amp;gt;ENABLE = 0;
NRF_UARTE1-&amp;gt;PSEL.TXD = 0xFFFFFFFF;
NRF_P0_NS-&amp;gt;OUTCLR = (1 &amp;lt;&amp;lt; TXD_PIN);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I attached a snippet from the UARTE chapter of the PS for the nRF9160, which is relevant when disabling this peripheral.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-64d6592a33ae438ea559e4428cae75b3/uart.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For TWI (I2C) it should be something similar, just read the product specification.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/thread/218947?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 05:27:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05a3c0ed-609a-4449-9acb-c1a3c450184c</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We want to enable/disable the peripheral at run time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So when firmware is running we want to disable I2C and then enable UART.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible to that ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 multiplex UART and other peripherals</title><link>https://devzone.nordicsemi.com/thread/218148?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 08:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3744abc7-d3ae-4c13-b468-d736f4b349f1</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]So is it possible to disable SPI / I2C when not in use and initialize 3rd UART and use it in the application ?[/quote]
&lt;p&gt;&amp;nbsp;Yes, this should be possible.&lt;/p&gt;
&lt;p&gt;Just enable to appropriate configs in the prj.conf file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>