<?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>is spi in nrf52832 consume large current ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17402/is-spi-in-nrf52832-consume-large-current</link><description>i measured the current of nrf52 dk board with the spi example (examples\peripheral\spi\pca10040). the result shows that it consumed about 6 mA !!!
i read the nrf52 datasheet, spi consumes up to 50 uA.
below is the example code,
int main(void)
{
LEDS_CONFIGURE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Oct 2016 11:49:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17402/is-spi-in-nrf52832-consume-large-current" /><item><title>RE: is spi in nrf52832 consume large current ?</title><link>https://devzone.nordicsemi.com/thread/66893?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2016 11:49:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffe8c35c-57e9-4b48-bdf6-248cdb78addf</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;The example in the SDK uses &lt;code&gt;nrf_delay_ms()&lt;/code&gt; function to wait for a new transaction. This function is basically just a for loop counter, which means that the CPU draws current all the time (several milliamps).&lt;/p&gt;
&lt;p&gt;You could use the RTC to trigger the SPI transfer and let the CPU sleep in between.&lt;/p&gt;
&lt;p&gt;Below is a modification to the SDK example code (SDK 11.0.0) that will do this. Notice that I&amp;#39;ve moved the code inside the &lt;code&gt;while(1)&lt;/code&gt; loop in &lt;code&gt;main()&lt;/code&gt; to the RTC interrupt handler. And it calls &lt;code&gt;__WFE()&lt;/code&gt; which puts the CPU to sleep until the RTC interrupt wakes it up.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also enabled the DCDC to use this more power efficient regulator. Remove this line if you don&amp;#39;t have DCDC components on your custom PCB. If you&amp;#39;re using the dev-kit, this should be enabled.&lt;/p&gt;
&lt;p&gt;Modified example: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1031.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To get the total SPI transfer current you have to add the peripheral clock current. SPI uses the peripheral clock which in turn requires the HF clock to be running. This can either be the the internal HF clock or an external crystal. &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_2_0_18_3_0#unique_729583919"&gt;infocenter.nordicsemi.com/.../clock.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also some current for the easy DMA must be taken into account (undocumented), since the SPIM peripheral writes directly to RAM using DMA.&lt;/p&gt;
&lt;p&gt;The HFCLK and DMA currents are only during transaction, and between the transactions you should expect to get the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_2_0_17_9_0#unique_1502638242"&gt;System ON base current&lt;/a&gt; pluss RTC and LF clock currents. About 2 µA in total.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>