<?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>Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus</link><description>My hardware only has one spi slave and one spi master. So can I just set the spi slave miso pin as output in spis_init function? If can not, can I set the pull down resistor on the slave miso pin on spis_init?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Jun 2019 09:09:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus" /><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195301?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 09:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac78f82a-7669-435c-9368-9ec9431529c3</guid><dc:creator>awneil</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus/195290"]I do not know how I can be any more clear[/quote]
&lt;p&gt;Indeed.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/cgha"&gt;cgha&lt;/a&gt;:&amp;nbsp; again, look at the SPI Slave example in the SDK - it will show you how to correctly configure the nRF as an SPI Slave.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195290?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 08:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61125835-0663-49eb-a485-361fa9b1d991</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I agree with awneil, you do not need a pull resistor on an SPI line unless something is seriously wrong.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I do not know how I can be any more clear than:&lt;br /&gt;&lt;span&gt;dir =&amp;nbsp;&lt;/span&gt;&lt;em&gt;NRF_GPIO_PIN_DIR_OUTPUT&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;br /&gt;input =&amp;nbsp;&lt;em&gt;NRF_GPIO_PIN_INPUT_DISCONNECT&lt;/em&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195271?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 07:44:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9919e678-6c3a-430c-8d28-17a5a40ff351</guid><dc:creator>awneil</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus/195188"]the miso is already an output[/quote]
&lt;p&gt;And that output will always be driving either high or low - because that&amp;#39;s what SPI requires.&lt;/p&gt;
&lt;p&gt;SPI is not like I2C - where pullups are required because open-drain outputs are used.&lt;/p&gt;
&lt;p&gt;Pull-up/down resistors serve no useful function in SPI - they purely waste power.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195237?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 01:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d702bfcb-283b-413c-b596-fb64e67c9469</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;@haakonsh do you mean set as input and enable pull down?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195236?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 01:25:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdb356d9-446e-499a-8d8c-8796410a6f61</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;nordic sdk set this miso pin as input&amp;amp;no pull when spis is initialized, and when it is selected(cs down), this pin function as miso, otherwise it is set as high impedence, just like other spi device, this is useful when there has more than one spi device on the bus. But in my system, there is only one spi device, So I want to set it as output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195189?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 14:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98813d91-1cd6-4f84-9667-698dccfbf7ee</guid><dc:creator>awneil</dc:creator><description>[quote userid="13562" url="~/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus/195188"]the miso is already an output[/quote]
&lt;p&gt;So, surely, it will always be driving&amp;nbsp;&lt;span&gt;&amp;nbsp;- either high or low ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Therefore a pull up/down is pointless - it will just waste power and serve no useful purpose at all?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195188?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 14:06:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0109065a-07ec-451b-b9f3-e3c461a3408a</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Oh, right, the miso is already an output, you just need to set the pull configuration.&amp;nbsp;&lt;br /&gt;Use&amp;nbsp;&lt;a title="nrf_gpio_cfg" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__gpio__hal.html?cp=5_1_6_9_0_11_0_6#ga0705ce3a78d0397bbdaec05a7bce693e"&gt;nrf_gpio_cfg&lt;/a&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;dir =&amp;nbsp;&lt;em&gt;NRF_GPIO_PIN_DIR_OUTPUT&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;br /&gt;input =&amp;nbsp;&lt;em&gt;NRF_GPIO_PIN_INPUT_DISCONNECT&lt;/em&gt;&amp;nbsp;&lt;br /&gt;pull =&amp;nbsp;&lt;em&gt;NRF_GPIO_PIN_PULLDOWN&lt;br /&gt;drive =&amp;nbsp;NRF_GPIO_PIN_S0S1&lt;br /&gt;sense =&amp;nbsp;NRF_GPIO_PIN_NOSENSE&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195187?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 14:05:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aca77a8-c53a-4ef8-a59d-e181cad7b480</guid><dc:creator>awneil</dc:creator><description>[quote userid="6959" url="~/f/nordic-q-a/49050/can-i-set-the-nrf51822-spis-miso-pin-as-output-when-there-is-only-one-spi-slave-and-one-spi-master-on-the-bus/195164"] I just want to give the miso pin on slave side an const value[/quote]
&lt;p&gt;But SPI requires a constant drive - either high or low - anyhow.&lt;/p&gt;
&lt;p&gt;SPI is not open-drain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195164?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 13:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c22411e-e7cf-4d7e-b74e-b6530ee936e9</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;Yes, I just want to give the miso pin on slave side an const value. The new sdk set this pin pull on master side, but my spi master is an otp mcu. I think the pullup or pull down resistor will cost more power in spi transfer, so I want to set this pin as output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195150?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 12:56:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b29849fe-c870-47cd-9a97-25efe5222bd2</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Yes, you can set the pull configuration in the PIN_CNF[x] register, but, are you sure that&amp;#39;s what you want to do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195142?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 12:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afe0208d-7491-4b3e-b9c1-584f0cb63c99</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;So do you mean I can set the intenal pull resistor on spis miso pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195115?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 11:34:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd1e71fd-e30e-4f26-b5db-edaeb49b1ca4</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand what you are trying to achieve by setting the SPIS miso pin as an output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195043?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 08:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b3f234b-27dd-4824-bc2d-6fa52c6bc4f7</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;Thanks for your information, but I think it does not help my question. In the sample code, miso pin has no pull, and this may put miso in float state.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195035?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 08:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d1d34a1-58eb-412d-a5d5-ea4303a6ab34</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/spi_slave_example.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/spi_slave_example.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195033?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c01bcd31-07a7-49f7-8862-ce200214b218</guid><dc:creator>cgha</dc:creator><description>&lt;p&gt;nrf51822 is spi slave, and the spi master is another 8bit mcu(with miso pin set as input and no pull).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I set the nrf51822 spis miso pin as output when there is only one spi slave and one spi master on the bus.</title><link>https://devzone.nordicsemi.com/thread/195022?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:43:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ea4b0e1-12e6-4472-919f-77da988469d6</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Is the nRF51822 the slave or the master?&lt;/p&gt;
&lt;p&gt;Or is this two&amp;nbsp;&lt;span&gt;nRF51822s connected by SPI - so one is slave, and the other is master?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>