<?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>MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38213/mcu-wakeup-from-sleep-by-a-timer</link><description>Hello, 
 I am using nRF52832 IC with softdevice and SDK v15. 
 I wish to make the MCU in sleep mode and then a couple of milliseconds (let&amp;#39;s say 250ms) wakes up the MCU. For this purpose, can I use the timer? Or do you have any idea ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Sep 2018 12:37:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38213/mcu-wakeup-from-sleep-by-a-timer" /><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147805?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 12:37:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3030667-3251-465f-a106-c1a347310cc3</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;No, I does not work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147802?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 12:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7041c6d9-dfac-4e6c-9814-de4e344ba452</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Turn off the RTC tick event and interrupt, then read out the content of the register again if it still does not work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147798?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 12:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a587e0d5-9617-4de7-8a91-819bbd27b73d</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;100.000 was an old trial number. even if I write 8 as the value, MCU never wakes up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147790?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 11:53:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38709086-f779-48b3-b2a3-3a3384b92db5</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;With a prescaler value of 4095dec you will get an RTC frequency of 8Hz (32768Hz / PRESCALER + 1), and with a compare value of 100 000dec you will not trigger an event until 3,5 hours (100 000 ticks/ 8Hz * 60s * 60m) have passed...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147774?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 11:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b437f2a-14e4-4cbc-a6a6-cc1976d4aa87</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;When it is running&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/8686.Untitled.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When It goes to sleep&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/8078.Untitled2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147769?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2018 11:15:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c82d01d3-12ce-41dc-bc2e-bed4fa05b105</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I need the content of the RTC2&amp;#39;s registers...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147599?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 13:19:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b730744b-0ab7-4709-896d-fde0fbd2692b</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;yes, enabled and started.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147588?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 12:33:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8697dfb-f8c0-45d5-aff3-3f2d8752a93e</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;&lt;span&gt;What is the state of the RTC2&amp;#39;s register after you&amp;#39;ve configured, enabled, and started it?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147546?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 10:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2fd12ae-80b3-4661-9b8c-f3fcac031f46</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;actually LED is blinking When the MCU is active. there is no wakeup event occurs When the MCU goes into sleep mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147530?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 09:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e15d511e-67fa-4246-a14f-c923f3296398</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What is the state of the RTC2&amp;#39;s register after you&amp;#39;ve configured, enabled, and started it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147512?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 08:54:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ade2c795-449d-400a-889e-d4669ac56406</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;OK, I used the RTC2. However, MCU never wakes up from sleep mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147504?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 08:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d39ed686-1502-46b2-8ec0-6cefe82454fe</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;RTC0 is used by the SoftDevice, RTC1 is used by the app_timer, I suggest you use RTC2 as the RTC instance.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147490?ContentTypeID=1</link><pubDate>Thu, 06 Sep 2018 07:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa470ae0-57d7-4b69-960c-ac031111a05e</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;When I do not use the below code into mine softdevice code, the code crashes at the line &amp;quot;ble_stack_init();&amp;quot;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    if (int_type == NRF_DRV_RTC_INT_COMPARE0)
    {
        nrf_gpio_pin_toggle(COMPARE_EVENT_OUTPUT);
    }
    else if (int_type == NRF_DRV_RTC_INT_TICK)
    {
        nrf_gpio_pin_toggle(TICK_EVENT_OUTPUT);
    }
}

/** @brief Function configuring gpio for pin toggling.
 */
static void leds_config(void)
{
    bsp_board_init(BSP_INIT_LEDS);
}

/** @brief Function starting the internal LFCLK XTAL oscillator.
 */
static void lfclk_config(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_clock_lfclk_request(NULL);
}

/** @brief Function initialization and configuration of RTC driver instance.
 */
static void rtc_config(void)
{
    uint32_t err_code;

    //Initialize RTC instance
    nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
    config.prescaler = 4095;
    err_code = nrf_drv_rtc_init(&amp;amp;rtc, &amp;amp;config, rtc_handler);
    APP_ERROR_CHECK(err_code);

    //Enable tick event &amp;amp; interrupt
    nrf_drv_rtc_tick_enable(&amp;amp;rtc,true);

    //Set compare channel to trigger interrupt after COMPARE_COUNTERTIME seconds
    err_code = nrf_drv_rtc_cc_set(&amp;amp;rtc,0,COMPARE_COUNTERTIME * 8,true);
    APP_ERROR_CHECK(err_code);

    //Power on RTC instance
    nrf_drv_rtc_enable(&amp;amp;rtc);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147419?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 14:42:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2675b1b5-ca0a-4dd4-9ef9-e154b39667fb</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Any interrupt will wake the CPU.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;I have external xtal. Do I need to use &amp;quot;lfclk&amp;quot;?&amp;quot;&lt;br /&gt;- Well, yes for the RTC you ned a LF clock source. If you&amp;#39;ve got a 32kHz crystal you can use the LFXO as the source. .&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147409?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 14:12:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a79070f-9557-48ba-bac2-9ec416260144</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;will this awake the MCU from sleep mode?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have external xtal. Do I need to use &amp;quot;lfclk&amp;quot;?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147407?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 14:00:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ef426fa-4c80-4897-9ac6-3e3a8c6cb2af</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You can use RTC1-2. You can also use the&amp;nbsp;&lt;a title="Timer library" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_timer.html?cp=4_0_1_3_48"&gt;Timer library&lt;/a&gt;&amp;nbsp;(app_timer), see also&amp;nbsp;&lt;a title="Application Timer" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__app__timer.html?cp=4_0_1_6_11_54"&gt;Application Timer&lt;/a&gt;&amp;nbsp;API docs.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147406?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 13:55:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88ef1600-799d-4b7c-8007-d48cbeb24760</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;Can I use it with the softdevice?&lt;/p&gt;
&lt;p&gt;I have external xtal. Do I need to use &amp;quot;lfclk&amp;quot;?&lt;/p&gt;
&lt;p&gt;In addition, does the resolution is second? I need resolution in&amp;nbsp;milliseconds&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU wakeup from sleep by a timer</title><link>https://devzone.nordicsemi.com/thread/147401?ContentTypeID=1</link><pubDate>Wed, 05 Sep 2018 13:46:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:876da040-4d0d-476f-98da-93d57eea2441</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You&amp;#39;ll want to use the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24#concept_rvn_vkj_sr"&gt;RTC — Real-time counter&lt;/a&gt;. See the&amp;nbsp;&lt;a title="Real Time Counter Example" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/rtc_example.html?cp=4_0_1_4_5_32"&gt;Real Time Counter Example&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a title="RTC" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__nrf__rtc.html?cp=4_0_1_6_9_0_16"&gt;RTC&lt;/a&gt;&amp;nbsp;API documentation.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>