<?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>Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40665/count-slow-pulses-most-power-friendly-way</link><description>nRF52832 custom board plus some devices. Using SDK 15 
 I want to count pulses from a previously configured accelerometer. Pulses are slow, around 500 per minute. 
 I have a working implementation using ppi, pin SENSE and a timer in counter mode. 
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Dec 2018 23:46:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40665/count-slow-pulses-most-power-friendly-way" /><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/160478?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 23:46:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43ea149c-6d86-4131-a1df-1186885ef583</guid><dc:creator>davidlr</dc:creator><description>&lt;p&gt;You are right Hakon. Your help is very appreciated.&lt;/p&gt;
&lt;p&gt;Problem was&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/Errata/nRF52832_Rev2/latest/ERR/nRF52832/Rev2/latest/anomaly_832_89#anomaly_832_89"&gt;Anomaly 89&lt;/a&gt;. After adding the workaround code&amp;nbsp;inside my TWI uninit function all is working as expected. As you said, 20uA&amp;nbsp;extra drawn by the IN_EVENT and I got around 20uA average in sleep&amp;nbsp; ON with your code too. What a nightmare!&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://media1.tenor.com/images/6ec3b904b9e3b8a444c282a240d48c58/tenor.gif?itemid=4771359" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you man, you rock!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/160440?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 15:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c246801-4b00-4d6a-9fc0-416bb8842e08</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Enabling IN_EVENT will give a bit of higher consumption (~20 uA), per this errata:&lt;/p&gt;
&lt;p&gt;&lt;a title="This anomaly applies to IC Rev. Rev 2, build codes QFAA-E00, CIAA-E00, QFAB-E00." href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev2.errata/dita/errata/nRF52832/Rev2/latest/anomaly_832_97.html#anomaly_832_97"&gt;&lt;span&gt;High current consumption in System ON Idle mode&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But it should not use 0.5 mA.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you run the example I posted standalone (based on $SDK/examples/peripherals/gpiote)? I get approx. 20 uA of sleep current with it on my nRF52-DK. If you keep the input pin active, you&amp;#39;ll see an added ~250 uA (from the pull resistor).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/160424?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 14:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98e48f90-9a58-4cff-8ce3-7d6c58222e58</guid><dc:creator>davidlr</dc:creator><description>&lt;p&gt;RTC can&amp;#39;t be used as counter as per documentation. Only possible source is&amp;nbsp;LF clock.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/160388?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 13:04:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16e83172-6b01-4508-b374-8d5186d6a75a</guid><dc:creator>davidlr</dc:creator><description>&lt;p&gt;Thanks, I am trying RTC.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/160384?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 13:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c2b36e1-cd55-4219-bde6-8e1112807a76</guid><dc:creator>davidlr</dc:creator><description>&lt;p&gt;Thanks for your kind reply &lt;span&gt;H&amp;aring;kon.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After enabling timer&amp;nbsp;nrfx_timer_enable(&amp;amp;m_timer) power consumption jumps from 40uA to 500uA.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also I understand from documentation that&amp;nbsp;NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO(true) with TRUE value enables IN_EVENT so the high frequency clock is requested (and more power drawn).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/158194?ContentTypeID=1</link><pubDate>Tue, 20 Nov 2018 13:32:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cfcadad-05bc-4745-a649-f74c2f33a482</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When a TIMER is in COUNT mode, it will be low power.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s an example, based on yours, that consumes very little in sleep mode (just toggles a LED every &amp;quot;AMOUNT_OF_PULSES&amp;quot; detected).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-334c4b4258c94bbb93d83bd6e0b2b332/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Your initial example uses the PORT event, and will then trigger if you have any other buttons configured with the PORT event as well, so I changed it to use GPIOTE-&amp;gt;IN instead.&lt;/p&gt;
&lt;p&gt;If you want to count the amount of pulses from an external source within a given time-frame, you could just comment out the call to &amp;quot;nrfx_timer_compare&amp;quot; + the second PPI channel and run a TASKS_CAPTURE[0] in a app_timer instance.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Count slow pulses, most power friendly way</title><link>https://devzone.nordicsemi.com/thread/158059?ContentTypeID=1</link><pubDate>Mon, 19 Nov 2018 17:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f34eeb89-6432-43f4-b9ab-7aa2fddd6a24</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;If you run the main timer hf clock is always on by default.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use the rtc timer instead. The rtc clock always runs and depending on which clock source you use is less than 3 microamp.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>