<?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>System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power</link><description>Hi Sir/Miss, 
 I&amp;#39;m using nrf52832, softdevice s132 and SDK 17.0.2. 
 In specification, I saw nrf52832 has a ultra low power mode. 
 It&amp;#39;s in system on with full retention RAM or without retention RAM. 
 I enable a RTC2 to tick and count the calendar, I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Jul 2022 12:05:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power" /><item><title>RE: System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/thread/378284?ContentTypeID=1</link><pubDate>Fri, 22 Jul 2022 12:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7a7a845-4636-4801-b89b-9139dafe284d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Countach"]In current code, I disable timer 2 and change function to&amp;nbsp;app_timer_create (like ble_app_hrs example) in our agent FAE&amp;#39;s suggestion.[/quote]
&lt;p&gt;Good, TIMER will have high current consumption. RTC/app_timer is low power.&lt;/p&gt;
[quote user="Countach"]In current code, it costs near 3uA. It looks like to spend some time reaching 3uA.[/quote]
&lt;p&gt;Yes, 3uA should be good, but I see in your video that it takes some time to reach this current. Could there be some averaging configuration of the Keysight unit that makes it take this long? I do not have any experience with this instrument myself. You should check the manual.&lt;/p&gt;
[quote user="Countach"]&lt;span&gt;&lt;span&gt;&lt;span&gt;I&amp;#39;ve ordered the PPK2 in one month ago. But, the lead time is too long which&amp;nbsp;needs 3 month. In current, I&amp;#39;m using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; keysight 34470A to measure it. The&amp;nbsp;sample rate is 50kHz. If it&amp;#39;s not enough, I should find another one before PPK2 arrival.[/quote]
&lt;p&gt;That is unfortunate. I believe 50 kHz should be enough, the PPK2 have maximum 100kHz sampling. Please check the manual of your instrument to make sure it is not configured in some averaging mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/thread/375255?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 07:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:824f2e9b-eb31-49ad-a653-e1da3f5dde2f</guid><dc:creator>Ben</dc:creator><description>[quote userid="14926" url="~/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power/374961"]I do not know what is inside your&amp;nbsp;timer2_init function. Is this using the TIMER peripheral, or is it an RTC timer?&amp;nbsp;[/quote]
&lt;p&gt;Yes,&amp;nbsp;timer2_init is using TIMER 2 peripheral. The code of timer2_init is as below:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;void timer2_init(void)
{
  ret_code_t err_code;
  
  nrf_drv_timer_config_t timer2_cfg;
  timer2_cfg.bit_width = NRF_TIMER_BIT_WIDTH_16;
  timer2_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
  timer2_cfg.interrupt_priority = APP_IRQ_PRIORITY_LOW; // Do not set high, that will impact setting up sleep mode
  timer2_cfg.mode = NRF_TIMER_MODE_TIMER;
  
  err_code = nrf_drv_timer_init(&amp;amp;m_timer2, &amp;amp;timer2_cfg, timer2_handler);
  APP_ERROR_CHECK(err_code);
  
  nrf_drv_timer_extended_compare(
         &amp;amp;m_timer2, NRF_TIMER_CC_CHANNEL0, nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer2 ,TIMER2_TICKS), 
         NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
  
  nrf_drv_timer_enable(&amp;amp;m_timer2);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In current code, I disable timer 2 and change function to&amp;nbsp;app_timer_create (like ble_app_hrs example) in our agent FAE&amp;#39;s suggestion.&lt;/span&gt;&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power/374961"]How did you configure the pin for wakeup? Enabling sense on the pin may not generate any events unless GPIOTE PORT event is also cleared. You may have a look at &lt;a href="https://github.com/NordicPlayground/nrf51-powerdown-examples/blob/master/system_on_wakeup_on_gpio/main.c"&gt;this example&lt;/a&gt;.[/quote]
&lt;p&gt;I change wakeup method with your tips and use&amp;nbsp;sd_power_mode_set(NRF_POWER_MODE_LOWPWR).&lt;/p&gt;
&lt;p&gt;It still has some problem with RTC.&amp;nbsp;When I &lt;strong&gt;remove&lt;/strong&gt; RTC function, it can wake up quickly.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/drv_5F00_calendar.c"&gt;devzone.nordicsemi.com/.../drv_5F00_calendar.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/08685.main.c"&gt;devzone.nordicsemi.com/.../08685.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Yellow (Channel 1) is button pin. Press one times (Low) to enter some process, and press again to enter idle mode.&lt;/p&gt;
&lt;p&gt;In first wake up, it should be pressed twice. But in second wake up, it should pressed few times to wake up. Please see below video.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/idle-mode-with-RTC.mp4"&gt;devzone.nordicsemi.com/.../idle-mode-with-RTC.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power/374961"]Other parts of the application, like logger, PWM, etc may also contribute to the current. If you should get lowest current, you need to disable all peripherals in your application.[/quote]
&lt;p&gt;In current code, it costs near 3uA. It looks like to spend some time reaching 3uA.&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/88774/system-on-and-keep-rtc-running-in-ultra-low-power/374961"]If you start the softdevice and advertising, the current will depend on the advertising interval and/or connection interval if any connections are established. What are you using to measure the current consumption? If your equipment does not have high enough sample rate, the current may not be correctly measured. If you do not have it already, I would highly recommend you to get a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_ppk2/UG/ppk/PPK_user_guide_Intro.html"&gt;PPK 2&lt;/a&gt; for current measurements.[/quote]
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;I&amp;#39;ve ordered the PPK2 in one month ago. But, the lead time is too long which&amp;nbsp;needs 3 month. In current, I&amp;#39;m using&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; keysight 34470A to measure it. The&amp;nbsp;sample rate is 50kHz. If it&amp;#39;s not enough, I should find another one before PPK2 arrival.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/thread/374961?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 15:46:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d920fc58-11a5-441d-ba60-69c406e436cc</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Countach"]Before this, I don&amp;#39;t run timer2_init() function (means comment &lt;span&gt;timer2_init()&lt;/span&gt;), sleep current can be near &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;1uA&lt;/strong&gt;&lt;/span&gt;. When I&amp;nbsp;remove comment on timer2_init() (means run timer2_init()), and I disable and run un-initial timer2 before sleep. It&amp;#39;s measured&amp;nbsp;about &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;45uA&lt;/span&gt;&lt;/strong&gt;. How do I close it?[/quote]
&lt;p&gt;I do not know what is inside your&amp;nbsp;timer2_init function. Is this using the TIMER peripheral, or is it an RTC timer?&amp;nbsp;&lt;/p&gt;
[quote user="Countach"]2. Base on above code, I &lt;strong&gt;can&amp;#39;t wake up&lt;/strong&gt; SoC after entering system on mode. In previous wake up code, it works in system off. Instead of sd_power_system_off() to using WFE and WFI, it is ARM low-power standby mode.&amp;nbsp; It should be triggered by events for waking up. But, it looks like not working in my GPIO wake up pin.[/quote]
&lt;p&gt;How did you configure the pin for wakeup? Enabling sense on the pin may not generate any events unless GPIOTE PORT event is also cleared. You may have a look at &lt;a href="https://github.com/NordicPlayground/nrf51-powerdown-examples/blob/master/system_on_wakeup_on_gpio/main.c"&gt;this example&lt;/a&gt;.&lt;/p&gt;
[quote user="Countach"]3. Enable comments at Question 3 block (RTC) and comment timer2_init() in above code.&amp;nbsp; The current measured &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;11uA&lt;/strong&gt;&lt;/span&gt;. It is not near 1.9 uA.&amp;nbsp;[/quote]
&lt;p&gt;Other parts of the application, like logger, PWM, etc may also contribute to the current. If you should get lowest current, you need to disable all peripherals in your application.&lt;/p&gt;
[quote user="Countach"]4.&amp;nbsp;Reserve RTC function (Question 3) and enable Question 4, and I don&amp;#39;t enable advertising in this part.&amp;nbsp;It has &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;820uA&lt;/strong&gt;&lt;/span&gt;. Which function should be disabled?[/quote]
&lt;p&gt;If you start the softdevice and advertising, the current will depend on the advertising interval and/or connection interval if any connections are established. What are you using to measure the current consumption? If your equipment does not have high enough sample rate, the current may not be correctly measured. If you do not have it already, I would highly recommend you to get a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_ppk2/UG/ppk/PPK_user_guide_Intro.html"&gt;PPK 2&lt;/a&gt; for current measurements.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/thread/371878?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2022 12:04:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c841ac28-c1d4-43db-8880-4b15abd07602</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;J&amp;oslash;rgen&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;I try to disable peripheral function.&amp;nbsp;Power saving is&amp;nbsp;under 1mA. But, it&amp;#39;s still too high. I try to separate some code to check sleep current. Therefore, I still have few questions.&lt;/p&gt;
&lt;p&gt;1. I comment BLE initial function code as below:&lt;/p&gt;
&lt;p&gt;Before this, I don&amp;#39;t run timer2_init() function (means comment &lt;span&gt;timer2_init()&lt;/span&gt;), sleep current can be near &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;1uA&lt;/strong&gt;&lt;/span&gt;. When I&amp;nbsp;remove comment on timer2_init() (means run timer2_init()), and I disable and run un-initial timer2 before sleep. It&amp;#39;s measured&amp;nbsp;about &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;45uA&lt;/span&gt;&lt;/strong&gt;. How do I close it?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//uart_init();
  log_init();

  timers_init();

  drv_gpio_configuration();
  
  pwm_init();
  
  saadc_sampling_event_init();
  saadc_init();
  timer2_init();      // Question 1
  
  /* Question 3
  sync_rtc(22, 6, 8, 20, 02, 55);
  lfclk_config();
  rtc_config();*/
  
  power_management_init();
  /* Question 4 comment for checking peripheral sleep current
  ble_stack_init();
  gap_params_init();
  gatt_init();
  services_init();
  advertising_init();
  conn_params_init();*/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Base on above code, I &lt;strong&gt;can&amp;#39;t wake up&lt;/strong&gt; SoC after entering system on mode. In previous wake up code, it works in system off. Instead of sd_power_system_off() to using WFE and WFI, it is ARM low-power standby mode.&amp;nbsp; It should be triggered by events for waking up. But, it looks like not working in my GPIO wake up pin.&lt;/p&gt;
&lt;p&gt;3. Enable comments at Question 3 block (RTC) and comment timer2_init() in above code.&amp;nbsp; The current measured &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;11uA&lt;/strong&gt;&lt;/span&gt;. It is not near 1.9 uA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp;Reserve RTC function (Question 3) and enable Question 4, and I don&amp;#39;t enable advertising in this part.&amp;nbsp;It has &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;820uA&lt;/strong&gt;&lt;/span&gt;. Which function should be disabled?&lt;/p&gt;
&lt;p&gt;Please assistance me to solve it.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System on and keep RTC running in ultra-low power</title><link>https://devzone.nordicsemi.com/thread/371688?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 13:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef124127-e108-4577-acf3-516b0b0ee263</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is possible to run the RTC in System ON mode, but not in System OFF. The expected current consumption is given by&amp;nbsp;&lt;span&gt;I&lt;/span&gt;&lt;sub&gt;ON_RAMOFF_RTC&lt;/sub&gt; in&amp;nbsp;&lt;a title="  Current consumption: Ultra-low power  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pmu.html?cp=4_2_0_16_0_0_2#unique_205654252"&gt;Current consumption: Ultra-low power&lt;/a&gt;, but note that any additional running peripheral will increase the current consumption, as entering System ON mode will not automatically power down peripherals.&lt;/p&gt;
&lt;p&gt;If you are measuring 2.x mA current, some additional peripherals must be running. The usual suspects at this current-level is for instance UARTE in receive mode, or the SAADC peripheral.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>