<?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>Power consumption nRF52840-DK in sleep mode while using UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50691/power-consumption-nrf52840-dk-in-sleep-mode-while-using-uart</link><description>Hello, 
 
 I&amp;#39;m trying to get sleep mode working on a nRF52840-DK with Zephyr or Mbed OS while using UART. 
 
 It is possible to achieve low current consumption in sleep mode (~3&amp;#181;A) while using I2C or SPI. The current remains at ~900&amp;#181;A in sleep mode when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 May 2020 14:00:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50691/power-consumption-nrf52840-dk-in-sleep-mode-while-using-uart" /><item><title>RE: Power consumption nRF52840-DK in sleep mode while using UART</title><link>https://devzone.nordicsemi.com/thread/249991?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 14:00:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b65721c-65ee-41f2-8d0a-7e85511220fb</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you create a new ticket for your issue?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Power consumption nRF52840-DK in sleep mode while using UART</title><link>https://devzone.nordicsemi.com/thread/249986?ContentTypeID=1</link><pubDate>Thu, 14 May 2020 13:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c3fdbe-354f-4e39-b921-3c5a4ebafc55</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;i am just trying to figure out what is happening.&lt;/p&gt;
&lt;p&gt;So what i have found out is that i got around 10uA current consumption with next setup:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;main.cpp&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  EventQueue mainEventQueue(64 * EVENTS_EVENT_SIZE);
  Thread mainEventQueueThread(osPriorityNormal, OS_STACK_SIZE, NULL, &amp;quot;MAIN.event.queue&amp;quot;);
  DebounceIn button1(BUTTON1);
  DigitalOut led(LED1);
  
  void onButton1Rise() {
      led = !led;
  }
  
  int main() {
      NRF_POWER-&amp;gt;DCDCEN = 0x00000001;
      NRF_UICR-&amp;gt;NFCPINS = 0x00000000;
      mbed_file_handle(STDIN_FILENO)-&amp;gt;enable_input(false);
      mainEventQueueThread.start(callback(&amp;amp;mainEventQueue, &amp;amp;EventQueue::dispatch_forever));
      button1.rise(mainEventQueue.event(onButton1Rise));
  }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;mbed_app.json&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="json"&gt;  {
  	&amp;quot;target_overrides&amp;quot;: {
  		&amp;quot;*&amp;quot;: {
  			&amp;quot;platform.stdio-baud-rate&amp;quot;: 115200,
  			&amp;quot;platform.stdio-convert-newlines&amp;quot;: true,
  			&amp;quot;target.console-uart&amp;quot;: false,
  			&amp;quot;target.device_has&amp;quot; : [
  				&amp;quot;STDIO_MESSAGES&amp;quot;
  			],
  			&amp;quot;target.features_add&amp;quot;: [&amp;quot;BLE&amp;quot;],
  			&amp;quot;platform.cpu-stats-enabled&amp;quot;: 1,
  			&amp;quot;platform.thread-stats-enabled&amp;quot;: 1,
  			&amp;quot;platform.error-filename-capture-enabled&amp;quot;: true,
  			&amp;quot;target.macros_add&amp;quot;: [
  				&amp;quot;DEVICE_SLEEP&amp;quot;,
  				&amp;quot;MBED_TICKLESS&amp;quot;,
  				&amp;quot;DEVICE_LPTICKER&amp;quot;,
  				&amp;quot;MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER=0&amp;quot;
  			],
  			&amp;quot;platform.callback-nontrivial&amp;quot;: true
  		}
  	}
  }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;my board:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://imgur.com/a/DFfoaY6"&gt;https://imgur.com/a/DFfoaY6&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;but after i created BufferedSerial object and delete it i got 600uA.&lt;/p&gt;
&lt;p&gt;So i was looking at the registers and found out the next thing:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LOW CURRENT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Registers in UART0:
	TASKS_STARTRX:  (not readable)  Start UART receiver
	TASKS_STOPRX:   (not readable)  Stop UART receiver
	TASKS_STARTTX:  (not readable)  Start UART transmitter
	TASKS_STOPTX:   (not readable)  Stop UART transmitter
	TASKS_SUSPEND:  (not readable)  Suspend UART
	EVENTS_CTS:                  0  CTS is activated (set low). Clear To Send.
	EVENTS_NCTS:                 0  CTS is deactivated (set high). Not Clear To Send.
	EVENTS_RXDRDY:               0  Data received in RXD
	EVENTS_TXDRDY:               0  Data sent from TXD
	EVENTS_ERROR:                0  Error detected
	EVENTS_RXTO:                 0  Receiver timeout
	SHORTS:                      0  Shortcuts between local events and tasks
	INTENSET:                    0  Enable interrupt
	INTENCLR:                    0  Disable interrupt
	ERRORSRC:                    0  Error source
	ENABLE:                      0  Enable UART
	PSEL:                       -1  Unspecified
	RXD:                         0  RXD register
	TXD:            (not readable)  TXD register
	BAUDRATE:             67108864  Baud rate. Accuracy depends on the HFCLK source selected.
	CONFIG:                      0  Configuration of parity and hardware flow control
Registers in UARTE0:
	TASKS_STARTRX:     (not readable)  Start UART receiver
	TASKS_STOPRX:      (not readable)  Stop UART receiver
	TASKS_STARTTX:     (not readable)  Start UART transmitter
	TASKS_STOPTX:      (not readable)  Stop UART transmitter
	TASKS_FLUSHRX:     (not readable)  Flush RX FIFO into RX buffer
	EVENTS_CTS:                     0  CTS is activated (set low). Clear To Send.
	EVENTS_NCTS:                    0  CTS is deactivated (set high). Not Clear To Send.
	EVENTS_RXDRDY:                  0  Data received in RXD (but potentially not yet transferred to Data RAM)
	EVENTS_ENDRX:                   0  Receive buffer is filled up
	EVENTS_TXDRDY:                  0  Data sent from TXD
	EVENTS_ENDTX:                   0  Last TX byte transmitted
	EVENTS_ERROR:                   0  Error detected
	EVENTS_RXTO:                    0  Receiver timeout
	EVENTS_RXSTARTED:               0  UART receiver has started
	EVENTS_TXSTARTED:               0  UART transmitter has started
	EVENTS_TXSTOPPED:               0  Transmitter stopped
	SHORTS:                         0  Shortcuts between local events and tasks
	INTEN:                          0  Enable or disable interrupt
	INTENSET:                       0  Enable interrupt
	INTENCLR:                       0  Disable interrupt
	ERRORSRC:                       0  Error source Note : this register is read / write one to clear.
	ENABLE:                         0  Enable UART
	PSEL:                          -1  Unspecified
	BAUDRATE:                67108864  Baud rate. Accuracy depends on the HFCLK source selected.
	RXD:                            0  RXD EasyDMA channel
	TXD:                            0  TXD EasyDMA channel
	CONFIG:                         0  Configuration of parity and hardware flow control&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HI CURRENT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;Registers in UART0:
	TASKS_STARTRX:  (not readable)  Start UART receiver
	TASKS_STOPRX:   (not readable)  Stop UART receiver
	TASKS_STARTTX:  (not readable)  Start UART transmitter
	TASKS_STOPTX:   (not readable)  Stop UART transmitter
	TASKS_SUSPEND:  (not readable)  Suspend UART
	EVENTS_CTS:                  1  CTS is activated (set low). Clear To Send.
	EVENTS_NCTS:                 0  CTS is deactivated (set high). Not Clear To Send.
	EVENTS_RXDRDY:               0  Data received in RXD
	EVENTS_TXDRDY:               1  Data sent from TXD
	EVENTS_ERROR:                0  Error detected
	EVENTS_RXTO:                 0  Receiver timeout
	SHORTS:                     32  Shortcuts between local events and tasks
	INTENSET:               524304  Enable interrupt
	INTENCLR:               524304  Disable interrupt
	ERRORSRC:                    0  Error source
	ENABLE:                      8  Enable UART
	PSEL:                       -1  Unspecified
	RXD:                         0  RXD register
	TXD:            (not readable)  TXD register
	BAUDRATE:              2576384  Baud rate. Accuracy depends on the HFCLK source selected.
	CONFIG:                      0  Configuration of parity and hardware flow control
Registers in UARTE0:
	TASKS_STARTRX:     (not readable)  Start UART receiver
	TASKS_STOPRX:      (not readable)  Stop UART receiver
	TASKS_STARTTX:     (not readable)  Start UART transmitter
	TASKS_STOPTX:      (not readable)  Stop UART transmitter
	TASKS_FLUSHRX:     (not readable)  Flush RX FIFO into RX buffer
	EVENTS_CTS:                     1  CTS is activated (set low). Clear To Send.
	EVENTS_NCTS:                    0  CTS is deactivated (set high). Not Clear To Send.
	EVENTS_RXDRDY:                  0  Data received in RXD (but potentially not yet transferred to Data RAM)
	EVENTS_ENDRX:                   0  Receive buffer is filled up
	EVENTS_TXDRDY:                  1  Data sent from TXD
	EVENTS_ENDTX:                   0  Last TX byte transmitted
	EVENTS_ERROR:                   0  Error detected
	EVENTS_RXTO:                    0  Receiver timeout
	EVENTS_RXSTARTED:               0  UART receiver has started
	EVENTS_TXSTARTED:               1  UART transmitter has started
	EVENTS_TXSTOPPED:               0  Transmitter stopped
	SHORTS:                        32  Shortcuts between local events and tasks
	INTEN:                     524304  Enable or disable interrupt
	INTENSET:                  524304  Enable interrupt
	INTENCLR:                  524304  Disable interrupt
	ERRORSRC:                       0  Error source Note : this register is read / write one to clear.
	ENABLE:                         8  Enable UART
	PSEL:                          -1  Unspecified
	BAUDRATE:                 2576384  Baud rate. Accuracy depends on the HFCLK source selected.
	RXD:                    536877297  RXD EasyDMA channel
	TXD:                    536877304  TXD EasyDMA channel
	CONFIG:                         0  Configuration of parity and hardware flow control&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So the UART is not deinited for some reason.&lt;/p&gt;
&lt;p&gt;After i did:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;stdio.enable_input(false);
stdio.enable_output(false);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the current dropped again init value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Power consumption nRF52840-DK in sleep mode while using UART</title><link>https://devzone.nordicsemi.com/thread/203834?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 13:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a394b27-023b-4015-b55a-9ea24cd10ff2</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is the HFCLK still running? What function are you using to set it in sleep mode, and could you share your project?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>