<?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>TWI and UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60896/twi-and-uart</link><description>Situation: SES, SDK 16, nRF52832, no BLE. 
 
 I&amp;#39;m trying to use both the UART and TWI 0. TWI works fine with BLE and all the rest. However, when I enable the UART, TWI quits working but the UART works just fine. 
 
 1) I checked instantiation - the two</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Mar 2021 08:58:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60896/twi-and-uart" /><item><title>RE: TWI and UART</title><link>https://devzone.nordicsemi.com/thread/299691?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 08:58:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21d49a3e-a95c-45fd-862b-4b0213d274ff</guid><dc:creator>SM_</dc:creator><description>&lt;p&gt;Hello Marti,&lt;/p&gt;
&lt;p&gt;Can you please share the working code of TWI and BLE?&lt;/p&gt;
&lt;p&gt;Are you using the custom BLE example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and UART</title><link>https://devzone.nordicsemi.com/thread/248237?ContentTypeID=1</link><pubDate>Tue, 05 May 2020 14:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0593061-a538-476c-a254-1b04ed0b6b9e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="jedmvpitech"]I can&amp;#39;t answer all because some things got fixed and I moved on.[/quote]
&lt;p&gt;I am happy you were able to resolve some of your issues.&lt;/p&gt;
[quote user="jedmvpitech"]2) Instantiation was checked through the nRF52832 chip manual to make sure (TI has this problem with shared serial peripherals).[/quote]
&lt;p&gt;Yes, resource sharing like this is quite common - but which TWIM instance did you use?&lt;br /&gt;TWIM0 and UARTE0 share the same IRQ, so if you used both of these that might be the cause of this.&lt;/p&gt;
[quote user="jedmvpitech"]4) I tried to run the UART direct without the FIFO and UARTE but always got an undefined typedef in one of the uart.h files (I forget which). I assume that with the FIFO enabled you need UARTE? Is there anyway of just running the raw UART without DMA?[/quote]
&lt;p&gt;Yes, you may use just the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuart.html&amp;amp;anchor=concept_dm5_drw_sr"&gt;UART peripheral&lt;/a&gt;, without the UARTE peripheral.&lt;br /&gt;You can disable both UARTE and UART easyDMA in the UART peripheral example with the following lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define UARTE_ENABLED 0 
#define UART_EASY_DMA_SUPPORT 0 
#define UART0_CONFIG_USE_EASY_DMA 0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="jedmvpitech"]This is another mysterious problem that went away but I&amp;#39;m not sure why and this seems to happen a lot.[/quote]
&lt;p&gt;Are you currently experiencing an issue you would like help resolving, or are you saying that the issue went away and will remain a mystery?&lt;br /&gt;In the case of the former, I am happy to help resolving it! And in the case of the latter, I am happy that you were able to resolve you issue and that both peripherals are currently working as expected.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and UART</title><link>https://devzone.nordicsemi.com/thread/248015?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 19:03:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbea13c5-d507-4caa-b292-e283cbc0a7a8</guid><dc:creator>Jed Marti</dc:creator><description>&lt;p&gt;I can&amp;#39;t answer all because some things got fixed and I moved on.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) I think I enabled TWI before the UART during failure. Initializing the UART first and now it seems to work. This is a guess as other stuff has changed.&lt;/p&gt;
&lt;p&gt;2) Instantiation was checked through the nRF52832 chip manual to make sure (TI has this problem with shared serial peripherals).&lt;/p&gt;
&lt;p&gt;3) Yes, using the peripheral demo and TWI as master from some other example. The TWI worked fine until I added the UART. And for the record, not a slave and not multi-master.&lt;/p&gt;
&lt;p&gt;4) I tried to run the UART direct without the FIFO and UARTE but always got an undefined typedef in one of the uart.h files (I forget which). I assume that with the FIFO enabled you need UARTE? Is there anyway of just running the raw UART without DMA?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is another mysterious problem that went away but I&amp;#39;m not sure why and this seems to happen a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI and UART</title><link>https://devzone.nordicsemi.com/thread/248001?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 17:48:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87f39560-0050-477b-a572-c69b51a5106d</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;That does sound strange. Right off the bat my suspicion is that they share a define/buffer/instance or pin, which the enabling of UART overwrites control of.&lt;br /&gt;Which pins are you using for both the UART and TWI?&lt;/p&gt;
[quote user=""]when I enable the UART, TWI quits working but the UART works just fine.[/quote]
&lt;p&gt;Could you also tell me some more about the behavior you are seeing? How do you determine that the TWI has stopped working?&lt;/p&gt;
[quote user=""]1) I checked instantiation - the two do not share.[/quote]
&lt;p&gt;How did you check this? I am just asking this to be sure before ruling it out.&lt;/p&gt;
[quote user=""]3) Using app_uart_fifo per the demo.[/quote]
&lt;p&gt;Are you working with a modified version of the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/uart_example.html"&gt;UART peripheral example&lt;/a&gt;, in which you have added TWI as demonstrated in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/twi_sensor_example.html"&gt;TWI Scanner example&lt;/a&gt;?&lt;br /&gt;If you are, please elaborate on what modifications and additions you have made to the exampe.&lt;br /&gt;Please correct me if I am wrong.&lt;br /&gt;For the record, are you implementing a TWI slave or master on your device?&lt;/p&gt;
[quote user=""]4) You can&amp;#39;t compile the legacy stuff required without UARTE enabled, there&amp;#39;s a compile time error.[/quote]
&lt;p&gt;This is interesting. Could you elaborate on what you mean by &amp;quot;legacy stuff&amp;quot; and which compile time error you are getting?&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together,&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>