<?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>Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74110/sharing-gpio-between-i2c-and-spi</link><description>Dear Members, 
 
 How can I share GPIO pin between SPI and I2C peripheral ? 
 I see SCK_PIN and MISO_PIN for SPI are the same with SCK and SDK on I2C 
 
 #define SER_APP_SPIM0_SCK_PIN NRF_GPIO_PIN_MAP(0,27) // SPI clock GPIO pin number. #define SER_APP_SPIM0_MOSI_PIN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Apr 2021 08:25:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74110/sharing-gpio-between-i2c-and-spi" /><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/306005?ContentTypeID=1</link><pubDate>Wed, 21 Apr 2021 08:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caeb2134-6316-4d5a-a1a9-2825a07df333</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Yes, you can use these pins, and they are not limited to &amp;quot;Low frequency IO only&amp;quot;. I was confused by your last comment where you said you wanted to use SD card (SPI) and LCD (I2C) on the same pins, but if both are running over SPI there should be no problems.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/305959?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 20:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44f9baf7-877c-41b3-837f-c5cbf1edda84</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My question is ,&lt;/p&gt;
&lt;p&gt;Is it possible that I use these GPIO for SPI ?&lt;/p&gt;
&lt;p&gt;P0.20 = MOSI&lt;/p&gt;
&lt;p&gt;P0.21=MISO&lt;/p&gt;
&lt;p&gt;P0.22=SCK&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I want to use SD card and LCD on the same SPI port only with different CS pin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/305908?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 14:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c73ffe7b-c352-4902-b807-407d17c22ced</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not sure if I understand your question. You cannot change the HW traces on the PCB from software, but you can configure which internal peripheral in the nRF52840 that is connected to receive or output data to the traces.&lt;/p&gt;
&lt;p&gt;I do not know if the devices you connect will work correctly if you output both SPI and I2C data to the same pins, without some kind of switch to disconnect the device(s) that uses another protocol. For instance, if you use the same pin for SPI and I2C clock and runs SPI at 8 MHz, this is way outside the maximum clock frequency supported by most I2C devices, and may cause damage or issues with the I2C device.&amp;nbsp;&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><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/305667?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 00:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af7876b8-70ac-4b38-87de-b4f9a5a94ff1</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;For example I use in PCB : &lt;/p&gt;
&lt;p&gt;P0.20 = MOSI&lt;/p&gt;
&lt;p&gt;P0.21=MISO&lt;/p&gt;
&lt;p&gt;P0.22=SCK&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;they&amp;#39;re configureable via software ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/305661?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 22:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8d71ae1-b845-4f3c-a4db-feb148688deb</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;Thanks for the reply,&lt;/p&gt;
&lt;p&gt;Any examples for doing on the PCB, I want to use SPI for SDcard and I2C for LCD&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sharing GPIO between I2C and SPI ?</title><link>https://devzone.nordicsemi.com/thread/305465?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 09:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af497954-dd92-4e8b-a61c-1f3522dd92c5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any GPIO can be assigned to any serial peripheral in all the nRF5x series ICs, thanks to the pin crossbar feature. Just disable one peripheral using the pins before assigning the pins to another peripheral. You cannot configure two different peripherals to control the same GPIOs at the same time.&lt;/p&gt;
&lt;p&gt;Note that the defines in the board header files are used for different examples, and may not all be intended for use by one example. These pins often chosen from convenience by the software developer, and may not be optimal from a HW perspective or for your application. E.g, make sure that you follow the guidelines with regards to &amp;quot;&lt;span&gt;Standard drive, low frequency I/O only&amp;quot; markings in&amp;nbsp;&lt;a title="Pin assignments" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/pin.html?cp=4_0_0_6_0"&gt;Pin assignments&lt;/a&gt;&amp;nbsp;documentation.&lt;/span&gt;&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>