<?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>Set SPI pins to tri-state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13807/set-spi-pins-to-tri-state</link><description>In one of our projects the nrf51 shares the SPI to a device with an STM32 microchip. To be able to successfully share the SPI channel, I&amp;#39;d have to put the SPI pins of the nrf51 into tri-state. I read that I could put them into tri-state by setting them</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 May 2016 14:33:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13807/set-spi-pins-to-tri-state" /><item><title>RE: Set SPI pins to tri-state</title><link>https://devzone.nordicsemi.com/thread/52754?ContentTypeID=1</link><pubDate>Fri, 13 May 2016 14:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83d9e1ae-0861-4987-b692-f0ca36ae9900</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You can put the SPI pins in the default configuration. This will set the pin in a high impedance mode. Set pin as input, disconnect input buffer, disconnect pull ups/downs, use standard drive, and disable pin sense mechanism. You can use &lt;code&gt;nrf_gpio_cfg_default()&lt;/code&gt; which is defined as follow:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__STATIC_INLINE void nrf_gpio_cfg_default(uint32_t pin_number)
{
    nrf_gpio_cfg(
            pin_number,
            NRF_GPIO_PIN_DIR_INPUT,
            NRF_GPIO_PIN_INPUT_DISCONNECT,
            NRF_GPIO_PIN_NOPULL,
            NRF_GPIO_PIN_S0S1,
            NRF_GPIO_PIN_NOSENSE);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To test it you can try to connect the pin to VDD and measure any current flowing into the pin. In high impedance mode it should be less than 1uA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>