<?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>nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44609/nrf52-wakeup-time</link><description>Hi, 
 what is the typical or max wake up time of the nRF52 from the RTC or GPIOTE irq (when configured as sense for low level input)? 
 
 In my setup, I see a wakeup time of ~13usec from the moment that the nRF52 current consumption is increasing, till</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Mar 2019 09:39:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44609/nrf52-wakeup-time" /><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176360?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 09:39:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c6a3a9d-ebcc-4f39-a991-663413a95396</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, this should be possible.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38651/can-t-copy-vector-table-to-ram-when-using-softdevice"&gt;This ticket&lt;/a&gt; should be helpful I think.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176338?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 08:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06bffa77-8c17-4ad3-8f4f-ff2f53541d62</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;One last question, in order to have the above wakeup time the vector table should be also placed in RAM. &lt;/p&gt;
&lt;p&gt;This is easy when you have an non BLE application.&lt;/p&gt;
&lt;p&gt;Is there a possibility to relocate the vector table in RAM with the Softdevice enabled?&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176256?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 15:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eefd913-8f3d-4b49-a63f-98356d3a6f6a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;This seems correct! Sorry I didn&amp;#39;t spot it. I don&amp;#39;t see any reason to go through your project now, so if you are satisfied we can close this case.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176188?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 13:11:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e09cbc7c-ac7d-49c6-83a2-2e69589acf4d</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;running the code from RAM seems to make the difference (GPIOTE irq executes after 3-4us of the external event).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Wakeup-from-RAM.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Wakeup-from-Flash.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;What is the reason for this difference?&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176140?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 10:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ff201f2-5817-4c5b-9e07-457c4b7d098f</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;please find attached the Keil project used for my tests.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF52_5F00_wakeup_5F00_v1.00.zip"&gt;devzone.nordicsemi.com/.../nRF52_5F00_wakeup_5F00_v1.00.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176116?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 09:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6343dc8f-fe06-4dad-b803-6b48a5b24a4f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am guessing there is more to the wake up process that is causing the additional delay then. I can look at your project, and measure it here on our scope of course, but I can&amp;#39;t guarantee that I will be able to decrease the delay any further.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/176034?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 17:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68bf42a8-0952-4d9d-a532-2edc7396084e</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have already changed to directly writing NRF_GPIO on the last test, but no significant change was observed (less than 1us).&lt;/p&gt;
&lt;p&gt;The delay is from the nRF52832 wakeup time, and exist on both wakeups RTC and GPIOTE. When I disable the WFI command and the processor is not going for sleep, then the GPIOTE irq handler kicks after ~1us from the external event. So the GPIOTE irq &amp;amp; NRF_GPIO pin write is running very fast!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the previous test, the PPI sets the GPIOTE pin automatically, but the GPIOTE task clear is done from the code inside of GPIOTE irq.&lt;/p&gt;
&lt;p&gt;If you would like I can attach the Keil project used for this test.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175945?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 13:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1df2b5f2-d436-4a15-8608-feb01845a695</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What about writing directly to NRF_GPIO, have you tried that yet to see if avoiding unnecessary headers reduces the delay. It seems here that the IRQ handler isn&amp;#39;t able to set before the PPI event is completed, so I think this is as low of a delay you are going to get using PPI. Try and see if writing directly will cut the delay any more, and I will take a closer look if that doesn&amp;#39;t work either.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175885?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 10:34:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e889880-6193-47fe-be0f-bbd2bf0f8586</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;using the PPI &amp;amp; GPIOTE to set a pin output, shows that the nRF52 is setting the output 3us after the wakeup pulse.&lt;/p&gt;
&lt;p&gt;The time for the GPIOTE irq handler to kick is ~12us.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Wakeup-from-GPIOTE-LOWPWR-DCDC-enabled.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The code used to set the pin output from the GPIOTE PORT event is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // ppi init - connect GPIOTE irq event to the GPIO_PPI_IRQ_PIN 
    nrf_ppi_channel_endpoint_setup(NRF_PPI_CHANNEL0, (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;EVENTS_PORT, (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;TASKS_SET[0]);
    nrf_ppi_channel_enable(NRF_PPI_CHANNEL0);
    
    // configure PPI GPIOTE pin
    nrf_gpiote_event_configure(0, GPIO_PPI_IRQ_PIN, NRF_GPIOTE_POLARITY_LOTOHI);
    nrf_gpiote_task_enable(0);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175723?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 14:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:045a70e5-f9a8-4f17-a111-9169fcdf49d9</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the CPU that I use is the nRF52832_xxAA.&lt;/p&gt;
&lt;p&gt;I will try to write direct to the NRF_GPIO to see if it has any measurable effect.&lt;/p&gt;
&lt;p&gt;I think your suggestion to use the NRF_GPIOTE-&amp;gt;EVENTS_PORT and feed it to the&lt;/p&gt;
&lt;p&gt;PPI to toggle a GPIO pin, it will show the accurate wakeup timing.&lt;/p&gt;
&lt;p&gt;I will let you know about the results.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Thanassis&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175703?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 14:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2735bf9-2aec-48cd-83da-314f5f26aea0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What is causing the extra time before the IRQ handler kicks in is likely that the GPIO driver causes some delay going through overheads. You can try writing to NRF_GPIO directly instead, to avoid any unnecessary calls. The nRF goes to sleep as soon as it is done, but you are measuring over a decoupling capacitor, which holds on to the voltage for some time, which is why you see the curve.&lt;/p&gt;
&lt;p&gt;I suggest you take a look at the &lt;a href="https://www.nordicsemi.com/DocLib/Content/Product_Spec/nRF52840/latest/ppi"&gt;PPI&lt;/a&gt;, as I suspect it may suit your application, seeing as it doesn&amp;#39;t depend on the CPU. I don&amp;#39;t know which chip you are using so I attached the link to the nRF52840 PPI, if you want to use it please make sure to read the correct PS.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175672?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 13:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e606111e-4081-4377-9e81-c3b9c7335c91</guid><dc:creator>tmav123</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;many thanks for your response.&lt;/p&gt;
&lt;p&gt;I am using the internal 64Mhz as nRF52 clock.&lt;/p&gt;
&lt;p&gt;As a LFCLK I am using an external 32.768Khz crystal which drives the RTC.&lt;/p&gt;
&lt;p&gt;So I was expecting to see tSTART_HFINT: 3us for the HFINT startup + tIDLE2CPU: 3us for the&lt;/p&gt;
&lt;p&gt;IDLE to CPU execute, but I see +10us till the irq handler is executed.&lt;/p&gt;
&lt;p&gt;In the bellow example, you could see a clearer wakeup sequence from an external GPIO signal.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/scope_5F00_12.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Is there anything else that I can do to reduce the extra 10us from my wake up time?&lt;/p&gt;
&lt;p&gt;Another question is what is the reason that it takes so long for the nRF52 to go to sleep again after a WFI command.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The code used for the above example is the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

//==============================================================================


#define GPIO_WAKEUP_PIN             2
#define GPIO_IRQ_PIN                4
#define NRF_WAKEUP_SHOW_PIN         28 

//==============================================================================
//==============================================================================

void GPIOTE_IRQHandler(void)
{
    nrf_gpio_pin_set(GPIO_IRQ_PIN);
    
    if(NRF_GPIOTE-&amp;gt;EVENTS_PORT)
    {
        if(NRF_P0-&amp;gt;LATCH &amp;amp; ( 1 &amp;lt;&amp;lt; GPIO_WAKEUP_PIN))
        {
            NRF_P0-&amp;gt;LATCH = 1 &amp;lt;&amp;lt; GPIO_WAKEUP_PIN;
        }
       
        NRF_GPIOTE-&amp;gt;EVENTS_PORT = 0;
    }
    nrf_gpio_pin_clear(GPIO_IRQ_PIN);
}

//==============================================================================
int main(void)
{
//    interrupts_disable();
    
    // enable Instruction Cache
    NRF_NVMC-&amp;gt;ICACHECNF |= NVMC_ICACHECNF_CACHEEN_Enabled &amp;lt;&amp;lt; NVMC_ICACHECNF_CACHEEN_Pos;
    // enable Instruction Cache profiling
    // check NRF_NVMC-&amp;gt;IHIT, NRF_NVMC-&amp;gt;IMISS registers for i-cache analysis
    NRF_NVMC-&amp;gt;ICACHECNF |= NVMC_ICACHECNF_CACHEPROFEN_Enabled &amp;lt;&amp;lt; NVMC_ICACHECNF_CACHEPROFEN_Pos;

    //enable the DCDC converter
    NRF_POWER-&amp;gt;DCDCEN = 1;
    //use the low power mode
    NRF_POWER-&amp;gt;TASKS_LOWPWR = 1;


    // setup gpio sense pin
    NRF_GPIO-&amp;gt;LATCH = (1&amp;lt;&amp;lt; GPIO_WAKEUP_PIN); //clear any latched DETECT
    NRF_GPIOTE-&amp;gt;EVENTS_PORT = 0;
    nrf_gpio_cfg_sense_input(GPIO_WAKEUP_PIN, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
    NRF_GPIOTE-&amp;gt;INTENSET = GPIOTE_INTENSET_PORT_Msk;
    NVIC_ClearPendingIRQ(GPIOTE_IRQn);
    NVIC_SetPriority(GPIOTE_IRQn, 6);  
    NVIC_EnableIRQ(GPIOTE_IRQn);
    
    nrf_gpio_cfg_output(GPIO_IRQ_PIN);
    nrf_gpio_cfg_output(NRF_WAKEUP_SHOW_PIN);
    nrf_gpio_cfg_output(RTC_IRQ_PIN);

    __enable_irq();
    
    while (true)
    {
        nrf_gpio_pin_clear(NRF_WAKEUP_SHOW_PIN);
        
        __WFI();
        
        nrf_gpio_pin_set(NRF_WAKEUP_SHOW_PIN);
        
    }
}
//==============================================================================
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 wakeup time</title><link>https://devzone.nordicsemi.com/thread/175260?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 08:51:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ba0b680-4ba4-41c1-9e0b-067e5e63e232</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Thanassis&lt;/p&gt;
&lt;p&gt;tSTART_HFINT startup time refers to the internal 64MHz oscillator, so when you are running on an external oscillator it nothing out of the normal that the startup time increases somewhat, actually I am surprised the startup delay isn&amp;#39;t longer. To get closer to the what the PS states you can try to use the internal oscillator (HFINT).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>