<?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>Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26277/disabling-enabling-spi-pins-for-sd-card</link><description>I want to save Power by disabling the SD Card. VCC of the card is already regulated with an external MOSFET switch and controlled by a pin of the nRF. The problem now is, that the SPI data lines still power the SD Card. Therefore, I want to disable them</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Aug 2018 18:01:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26277/disabling-enabling-spi-pins-for-sd-card" /><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/143088?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 18:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1606a0eb-df87-441e-a967-d6f370608ca3</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;This is not related to this question, unless you cut VCC to the SD Card. Please post a new question where you described your issue and setup in details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/143085?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 17:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1601688d-9e55-4e51-8979-e0df32a25e99</guid><dc:creator>Renato Silva</dc:creator><description>&lt;p&gt;Did you resolve this problem?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have a problem in fatfs example (SDK14)&lt;/p&gt;
&lt;p&gt;The serial show me the follow error.&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: FATFS example.&lt;br /&gt;&amp;lt;info&amp;gt; app: Initializing disk 0 (SDC)...&lt;br /&gt;&amp;lt;info&amp;gt; app: Capacity: 59400 MB&lt;br /&gt;&amp;lt;info&amp;gt; app: Mounting volume...&lt;br /&gt;&amp;lt;info&amp;gt; app: Mount failed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103430?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2017 08:51:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7ac5a9c-f3bd-4272-8bfb-8645577cf867</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can only drive pins configured as output low. You can configure the pull-settings of the MISO line using the &lt;em&gt;sdk_config&lt;/em&gt; macro &lt;code&gt;NRF_SPI_DRV_MISO_PULLUP_CFG&lt;/code&gt; (in SDK 14.1.0).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103432?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 13:45:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10e1b283-4043-47d6-a553-3dc9683452d5</guid><dc:creator>Cornel Br&amp;#252;lisauer</dc:creator><description>&lt;p&gt;Ok, thank you for your help. Maybe I can save some power somewhere else. One last try may be to force all SPI data lines low. Is this possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103431?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 13:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c51b1b1-d65b-422b-9991-bbb7d6e9b12b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;This is what I could find in chapter 7 of the &lt;a href="https://www.sdcard.org/downloads/pls/click.php?p=Part1_Physical_Layer_Simplified_Specification_Ver6.00.jpg&amp;amp;f=Part1_Physical_Layer_Simplified_Specification_Ver6.00.pdf&amp;amp;e=EN_SS1"&gt;SD card Physical Layer simplified specifications&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The SD card is powered up in the SD
mode. It will enter SPI mode if the CS
signal is asserted (negative) during
the reception of the reset
command(CMD0).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I suspect this will cause the issue you are seing, if you do not perform the initialization sequence after power on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103429?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 10:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0985a68-5afd-44a8-9b06-63b24b461c4d</guid><dc:creator>Cornel Br&amp;#252;lisauer</dc:creator><description>&lt;p&gt;No, unfortunately I don&amp;#39;t know. This was my question in the beginning and I hoped sombody may no about this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103428?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 08:43:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91d4dd95-1e76-4483-8c86-bb81b68d458a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you know if the SD card can work after VCC have been cut, without reinitialization?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103427?ContentTypeID=1</link><pubDate>Fri, 27 Oct 2017 07:37:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:198444a9-7030-4e55-b821-2715007c310e</guid><dc:creator>Cornel Br&amp;#252;lisauer</dc:creator><description>&lt;p&gt;That is a mistake. I looked in the datasheet and accidentally looked up the register configuration for the SPIM module, not the SPI module. I thought, that the connect bit needs to be set, thats why I added &lt;code&gt;|0x80000000&lt;/code&gt;. It is now not stuck anymore in the default_wait_function(void), but it fails to mount the card. The f_mount function returns FR_DISK_ERR. The SPI works after reconnecting, I tested it with a logic analyzer. But the MISO signal stays high constantly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103426?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 14:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:011a39e7-3e4f-46a8-9f1d-4f0a1e894760</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What is the &lt;code&gt;| 0x80000000&lt;/code&gt; for?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103425?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 14:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:518445d5-03ff-497e-837d-a30176a1b13b</guid><dc:creator>Cornel Br&amp;#252;lisauer</dc:creator><description>&lt;p&gt;It is also a mystery to me, why there is still a voltage at the vcc line. But still, I want to disconnect the pins, in order to save power anyhow. But maybe I have to look into my mosfet switch again... I am using the SPI peripheral (SDK 12.3). The disconnect works fine. But now I have problems with enabling it again.  I enable the pins like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; NRF_SPI1-&amp;gt;PSEL.SCK = SDC_SCK_PIN | 0x80000000;
	NRF_SPI1-&amp;gt;PSEL.MISO = SDC_MISO_PIN | 0x80000000;
	NRF_SPI1-&amp;gt;PSEL.MOSI = SDC_MOSI_PIN | 0x80000000;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is that correct? If I then use the function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   if (f_mount(&amp;amp;Fatfs,&amp;quot;/&amp;quot;,1) != FR_OK)
  {
		NRF_LOG_INFO(&amp;quot;Mount failed.\r\n&amp;quot;);
		return;
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It gets stuck in the default_wait_func(void) function in the file diskio_blkdev.c and stays there forever. Am I doing something wrong when reconnecting the pin or do I need to initialize the card again (as shown in the first question)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disabling/enabling SPI Pins for SD Card</title><link>https://devzone.nordicsemi.com/thread/103424?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 12:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc94f5e7-da5b-45bf-8a0b-7c14f07e0c56</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand how the SPI data lines can power your SD card if you have disconnected VCC. You can try disconnecting the pins of the SPI peripheral by setting the PSEL registers to disable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_SPIMx-&amp;gt;PSEL.SCK = (SPIM_PSEL_SCK_CONNECT_Disconnected&amp;lt;&amp;lt; SPIM_PSEL_SCK_CONNECT_Pos)
NRF_SPIMx-&amp;gt;PSEL.MOSI = (SPIM_PSEL_MOSI_CONNECT_Disconnected &amp;lt;&amp;lt; SPIM_PSEL_MOSI_CONNECT_Pos)
NRF_SPIMx-&amp;gt;PSEL.MISO = (SPIM_PSEL_MISO_CONNECT_Disconnected &amp;lt;&amp;lt; SPIM_PSEL_MISO_CONNECT_Pos)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you are using SPIM peripheral (with EasyDMA support), where x is the SPIM instance used.&lt;/p&gt;
&lt;p&gt;Note that you need to connect the pins again before the SPI can do any transfers again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>