<?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>Same pin selected in PSEL registers in multiple peripherals</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37337/same-pin-selected-in-psel-registers-in-multiple-peripherals</link><description>We&amp;#39;re writing code that does dynamic pin assignment which may change over time. This question is about how the crossbar deals with conflicting pin settings. 
 If I set the same pin in the PSEL registers for two different peripherals (e.g. first SPI0 and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Aug 2018 12:35:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37337/same-pin-selected-in-psel-registers-in-multiple-peripherals" /><item><title>RE: Same pin selected in PSEL registers in multiple peripherals</title><link>https://devzone.nordicsemi.com/thread/143722?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 12:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:202ae344-d3d6-46ec-923e-9be82f0f300c</guid><dc:creator>Dan Halbert</dc:creator><description>&lt;p&gt;Thank you. This is very helpful. And the SPI/TWI example was casually chosen -- thanks for noting it&amp;#39;s not typical.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Same pin selected in PSEL registers in multiple peripherals</title><link>https://devzone.nordicsemi.com/thread/143719?ContentTypeID=1</link><pubDate>Fri, 10 Aug 2018 12:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12bcde9d-0fc0-464f-a435-235ae21569d6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If multiple peripherals are configured to the same pins, then the last peripheral that is enabled will internally claim/takeover the pins. You don’t need to clear the peripherals PSEL register, but you should properly uninitialize the previous peripheral before you enable the new one, i.e. disable IRQs, disable interrupts, wait for previous transfers to finish, and at last set the ENABLE register field to disabled. If you are using our drivers, then this is done for you by the uninit functions(e.g. nrf_drv_spi_uninit()).&lt;/p&gt;
&lt;p&gt;Note that SPIM0 and TWIM0 have the same ID/base addresses(see the instantiation table &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/memory.html?cp=2_0_0_3_1_3#topic"&gt;here&lt;/a&gt;). See also &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/17035/twi0-and-spi0-time-multiplex/65343#65343"&gt;this post&lt;/a&gt;&amp;nbsp;for some more info about that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Sigurd&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>