<?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>GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20307/gpiote-and-spi-high-power-consumption-on-sleep</link><description>Hello everyone. 
 I am currently working on a device with some peripherals.
I have SPI slaves and other sensors that I am monitoring using GPIOTE driver. 
 I noticed a consumption of 0.470mA while sleeping under the following circumstances: 
 
 Configure</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Mar 2017 19:29:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20307/gpiote-and-spi-high-power-consumption-on-sleep" /><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79122?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2017 19:29:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9217d43b-7254-4049-9fd5-37984cb874b4</guid><dc:creator>ColdBrew667</dc:creator><description>&lt;p&gt;Thank you so much Stian, this is a mystery resolved!
The workaround is working fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79121?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2017 09:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2998ad2f-5951-464b-b4f0-b31be5d0c56f</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What has been discussed in the other answers are described in this errata: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_97.html"&gt;infocenter.nordicsemi.com/.../anomaly_832_97.html&lt;/a&gt;. This should not cause more than 20µA, so I believe this could be related to something else.&lt;/p&gt;
&lt;p&gt;There is an errata describing problems with TWI together with GPIOTE: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_89.html"&gt;infocenter.nordicsemi.com/.../anomaly_832_89.html&lt;/a&gt;. Although the errata only mention TWI, SPI is sharing resources with TWI so same thing could happen with SPI.&lt;/p&gt;
&lt;p&gt;So, the bug is in TWI in general. Peripherals sharing resources with TWI0 is TWIS0, TWIM0, SPI0, SPIM0 and SPIS0. Peripherals sharing resources with TWI1 is TWIS1, TWIM1, SPI1, SPIM1 and SPIS1. &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html#topic"&gt;infocenter.nordicsemi.com/.../memory.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;SPI2 is not sharing resources with a TWI peripheral, so it should not be impacted by this bug.&lt;/p&gt;
&lt;p&gt;You can try to use SPI2 instead, or use the workaround provided in the errata and see what happens.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79120?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 21:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce79989a-3898-49ab-9ab6-ba1b59d52ef0</guid><dc:creator>ColdBrew667</dc:creator><description>&lt;p&gt;I highly doubt that the SPI hardware is at fault. I can reproduce the issue using PCA10040 and spis example as slave for SPI hardware. This example is just echoing back what I am sending and I am sending thing upon button push only.
I don&amp;#39;t believe that it is related to hardware but more as a combination of execution of the two drivers one after the other.
Like SPI is activating an oscillator for clock generation and suspend its usage and then when GPIOTE comes into picture it uses it somehow and lives it running before going to sleep.
I will try the port mode but I don&amp;#39;t think that it will be a real solution for our whole system.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79119?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 20:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b731140-a6e8-4bb8-acef-30e000010eb4</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;AFIK the bug was fixed in the nRF52, but as it is such a small change to the code, I suggest you try it.&lt;/p&gt;
&lt;p&gt;If changing it does not fix the problem, there are several other options.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Your SPI hardware is taking the power.&lt;/li&gt;
&lt;li&gt;Your SPI hardware is constantly generating interrupts.&lt;/li&gt;
&lt;li&gt;This problem is not actually related to the SPI&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79116?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 19:23:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e34b34a2-9ec4-48b4-8d5e-11f40e6388d9</guid><dc:creator>ColdBrew667</dc:creator><description>&lt;p&gt;I tried this but then the &lt;code&gt;nrf_drv_gpiote_in_init()&lt;/code&gt; function comes back with an error 0x0004 (no memory for operation) and I couldn&amp;#39;t explain why... Is there something more to do while using this way of doing it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79118?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 19:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:481e7858-1537-47e3-bda9-4711dffb0a0f</guid><dc:creator>ColdBrew667</dc:creator><description>&lt;p&gt;Hello, thank you for your answer but I do not use nRF51 but nRF52. Is this hardware bug still present on this last chip?
Moreover, if I am using GPIOTE alone I do not see any power consumption. It is really the combination of SPI and GPIOTE that causes the issue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79117?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 03:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20696b15-7649-446c-a484-19888e5b112f</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Just to elaborate&lt;/p&gt;
&lt;p&gt;See this question&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/2471/gpio-wakeup-low-power-workarounds/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Basically there is a problem with the nRF51 hardware, which requires the HF (16Mhz) oscillator to be running to in order for an interrupt on an individual pin to trigger an interrupt.&lt;/p&gt;
&lt;p&gt;So you need to use &amp;quot;Port mode&amp;quot; instead but calling&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This mode does not require the HF oscillator to run.&lt;/p&gt;
&lt;p&gt;However, in this mode, if you have more than on interrupt input pin, you need to read the value of the pin(s) inside the ISR to confirm which pin has caused the interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE and SPI high power consumption on sleep</title><link>https://devzone.nordicsemi.com/thread/79115?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 02:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a24018fa-f873-4fcd-ba87-e0ef1e2afc8f</guid><dc:creator>Gustavo Velasco-Hern&amp;#225;ndez</dc:creator><description>&lt;p&gt;use this instead:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;this will set accuracy to low and decrease the power consumption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>