<?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>Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19580/slow-wake-up-and-timer-start-from-power-off</link><description>Hello, 
 I am trying to set the nRF52 to power off and wake up on a momentary button push (scope measures momentary push logic low around 50ms-100ms). However, I am struggling to have my debounce timer start up fast enough to detect the button being</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Feb 2017 12:14:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19580/slow-wake-up-and-timer-start-from-power-off" /><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76187?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2017 12:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50833332-a061-4c86-9856-de5514148c97</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Great that it worked!&lt;/p&gt;
&lt;p&gt;The app_timer should not be faster than the timer in such a way that it should matter in this case, so I think it was something about the way you set up and used the timer. However I cannot see what was wrong. Anyway I guess we don&amp;#39;t have find out if you are happy with the new solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76188?ContentTypeID=1</link><pubDate>Sun, 12 Feb 2017 05:41:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e3b7f7d-06d2-4c1c-a64a-413f7662b04c</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Ole - Excellent comment, this worked.  I am still a bit baffled as to why the app timer starts so much faster than a standard timer.  I am able to go to full power down, press a button and catch the button pressed with a few debounce timer increments.  Boosting a 200-300na off current with enthrall my client. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76186?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 09:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:958f8f3a-5437-4e7b-bdf1-fd7a2fb97773</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can do a quick test of the wake-up time, just toggle a pin at the start of your code and measure the distance between the falling edge that woke up your chip and the pin toggle. Doing this I got around 300us which is reasonable and much less than 50ms.&lt;/p&gt;
&lt;p&gt;It seems to me that you are doing things in a hard way here. You know that the pin woke you up or a reset did it (see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_2_0_17_1#unique_863354678"&gt;here&lt;/a&gt;). If you have multiple pins you can wake up from you can read them at startup to find out which one it was. Then you can start a timer to check the pin at a later point in time if the button/pin is still pushed. I would recommend using RTC instead of the TIMER as it draws a lot less current (1uA versus couple of 100uA). The app_timer module is easy to use for this purpose. If you have not used it before you can checkout &lt;a href="https://devzone.nordicsemi.com/tutorials/19"&gt;this&lt;/a&gt; tutorial.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76185?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 02:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d393652-55d4-4418-b7b9-16674ca8b687</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;When I did some research into batteries, many claimed &amp;quot;long shelf life&amp;quot; and there are articles saying that some coin cells can have 10 years of operation / shelf life&lt;/p&gt;
&lt;p&gt;However when I read the spec&amp;#39;s from both Sony etc, they mostly omit exact figures for shelf life e.g.
&lt;a href="http://www.sony.net/Products/MicroBattery/cr/pdf/cr2032.pdf"&gt;www.sony.net/.../cr2032.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Panasonic imply longer shelf / usable life but don&amp;#39;t seem to explicitly say what it is.&lt;/p&gt;
&lt;p&gt;Some manufacturers will warrant their batteries for 1 year, but I&amp;#39;ve not personally seen any warranty beyond that.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not a battery expert, but most batteries I have experienced seem to have some form of chemical degradation after a few years and often leakage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76184?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 00:53:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1005c1b-ce68-40f8-b216-58bc35f19334</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Assuming it takes 50mS to start up from cold, and your button takes 200mS to settle down,
Then you won&amp;#39;t know for 200mS whether its a long or a short press (or perhaps 200mS is the time for a long press - not that makes any difference to this)&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Well, my hope is that is does not take 50 ms to start up from cold.  If it does then i have no option but to assume a wake up without the button pushed continually is a short press.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Why are you using Power Off? To extend your battery life on a very small battery? I&amp;#39;m surprised that just turning off advertising would not be low enough power Or are you running from harvested energy?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I am running off a coin cell, i think those usually have a leakage of about a 1uA.  Perhaps I should do some tests on sleep current in other modes.  The power is just so nice in the off mode it would make this thing rock solid in the battery life department&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76183?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 00:19:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77dfac82-b4c1-4578-bd0d-13c9bba5eb09</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@LukeC&lt;/p&gt;
&lt;p&gt;OK. I see what you are doing.&lt;/p&gt;
&lt;p&gt;But I&amp;#39;m not sure how the logic of this is going to work..&lt;/p&gt;
&lt;p&gt;Assuming it takes 50mS to start up from cold, and your button takes 200mS to settle down,&lt;/p&gt;
&lt;p&gt;Then you won&amp;#39;t know for 200mS whether its a long or a short press (or perhaps 200mS is the time for a long press - not that makes any difference to this)&lt;/p&gt;
&lt;p&gt;So how is it possible to &amp;quot;blast out&amp;quot; an advertising packet and go back to sleep in under the time taken for a long press.&lt;/p&gt;
&lt;p&gt;Or would you immediately blast out an advert (takes about 5mS) and then wait for 200mS and recheck the button, and if so treat it as a long press and change the advert.&lt;/p&gt;
&lt;p&gt;Why are you using Power Off? To extend your battery life on a very small battery?
I&amp;#39;m surprised that just turning off advertising  would not be low enough power
Or are you running from harvested energy?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76182?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2017 23:36:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e52a2dae-22c0-4a4e-a952-7b0174e40f14</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BUTTON_1       13

#define button1_is_pressed() !nrf_drv_gpiote_in_is_set(BUTTON_1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The basic functionality is part has one physical button, one press it wakes up and blasts out an advertising packet and goes back to power off. It can also do a long press which changes the advertising data, this is working perfectly.  It is only the short presses that it is missing.&lt;/p&gt;
&lt;p&gt;It still seems like a very slow wake up time.  Perhaps I need to go through and scour the data sheets to see total time it takes to get the internal oscillator and everything setup.&lt;/p&gt;
&lt;p&gt;I am sure if a just put a cap on it this will keep me from spurious presses, but it sure seem like I should be able to wake up quick enough to see this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76181?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2017 22:47:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ac846c8-2cd6-4945-a5cf-a7f214554dc1</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@LukeC&lt;/p&gt;
&lt;p&gt;What code is in your button1_is_pressed() ?&lt;/p&gt;
&lt;p&gt;Also. Why do you want to read the button ?&lt;/p&gt;
&lt;p&gt;Does the button serve more than one function, and is not just used to wake the board up ?&lt;/p&gt;
&lt;p&gt;Does something special happen if the system is started by this button being pressed ?&lt;/p&gt;
&lt;p&gt;If so, I suspect there is another solution to the problem using flags retained in RAM (albeit a small cost in the current use in power off mode)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76180?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2017 20:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:803919b2-2994-496c-a5d1-d48c07f14bf9</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Roger - That is certainly possible, though many of our designs are space constrained so every hardware placement matters.  Also, it just seems to be good coding practice to see a button pressed over some period of time - perhaps it is overly cautious.&lt;/p&gt;
&lt;p&gt;Ole - I am using the internal pull-up.  I have the edge interrupt setup to activate on any edge which sets the flag &amp;quot;btnpressed&amp;quot;.&lt;/p&gt;
&lt;p&gt;Here is my GPIO event handler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void
in_pin_handler (nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{

  if (button1_is_pressed())
    {
      btnpressed = 1;
    }
  else
    {
      btnreleased = 1;
    }

}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76179?ContentTypeID=1</link><pubDate>Thu, 09 Feb 2017 13:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8f488cf-0d5c-47eb-8b87-72dda7beb7eb</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The real start up time is not 16.5us. The real start up time will also include start up of resources like flash, clocks and regulators. However it should take much less than 50 ms to from the wake-up signal to you read the button in the code.&lt;/p&gt;
&lt;p&gt;Why are you setting up the button as gpiote IN before you read the state of the button (using button1_is_pressed(). I assume this reads BUTTON_1 pin)? Do you have a pull-up on the button such that it doesn&amp;#39;t float when it is not pressed? For momentary press is btnpressed ever set to &amp;#39;1&amp;#39;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Slow Wake-Up and Timer Start from Power Off</title><link>https://devzone.nordicsemi.com/thread/76178?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2017 21:01:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266ba2df-6291-416c-a743-8a14ca92470b</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Have you considered using a circuit to debounce the button e.g. 2 resistors and one capacitor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>