<?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>Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34702/regarding-nrf-52832-power-consumption-saadc-ppi-timer</link><description>Hi everybody I have a couple of questions regarding power consumption for the nRF 52 DK Rev. 1 (nRF52832). I currently have an application where I sample 12-bit ADC data via the SAADC at a frequency of 8kHz. These samples are stored in buffers of 480</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 May 2018 14:49:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34702/regarding-nrf-52832-power-consumption-saadc-ppi-timer" /><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133872?ContentTypeID=1</link><pubDate>Tue, 29 May 2018 14:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e236d30-bb77-405e-a26b-b4cef6e711f3</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;You are welcome Nick; thanks for letting me know it helped.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133710?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 18:56:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec08024-c601-4eea-ba0b-7b155d8cab53</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Hi hmolesworth&lt;/p&gt;
&lt;p&gt;Thanks for the reply. It does indeed work with this sequence.&lt;/p&gt;
&lt;p&gt;I now initialize the saadc inside main (without enabling it), I then enable the saadc, the channels, buffers, etc. upon a NOTIFICATION_ENABLE request, and disable the the saadc with the new sequence.&lt;/p&gt;
&lt;p&gt;Looks as follows:&lt;/p&gt;
&lt;p&gt;upon a NOTIFICATION_ENABLE:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void enable_saadc_on_connect(void)
{      
    ret_code_t err_code;
    
    nrf_saadc_channel_config_t channel_config =
    NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);
    
    err_code = nrf_drv_saadc_channel_init(0, &amp;amp;channel_config);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);
//    NRF_LOG_INFO(&amp;quot;buffer 1 init&amp;quot;);
    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);
//    NRF_LOG_INFO(&amp;quot;buffer 2 init&amp;quot;);
    
    nrf_saadc_enable();
    saadc_sampling_event_init();
    saadc_sampling_event_enable();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and on disconnect:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;static void uninit_saadc_on_disconnect(void)
{
    nrf_drv_timer_disable(&amp;amp;m_timer);
    nrf_drv_timer_uninit(&amp;amp;m_timer);
    
    nrf_drv_ppi_channel_disable(m_ppi_channel);
    nrf_drv_ppi_uninit();
    
    nrf_saadc_task_trigger(NRF_SAADC_TASK_STOP);
    nrf_saadc_event_clear(NRF_SAADC_EVENT_STARTED);
    nrf_saadc_event_clear(NRF_SAADC_EVENT_END);
    nrf_saadc_disable();
//    nrf_drv_saadc_abort();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for your help!&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133655?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 12:41:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a120372d-6054-414b-9561-b255122a069d</guid><dc:creator>haakonsh</dc:creator><description>&lt;ol&gt;
&lt;li&gt;You can use breakpoints or stop the CPU at any time and read the registers, but you cannot continue execution as the SoftDevice will crash. Our supported IDEs have special view windows to read the content of our peripherals registers. They are very useful when debugging. F.Ex. In Segger Embedded studio, enter debug mode click View-&amp;gt;Registers-&amp;gt;Registers 1-&amp;gt;Groups.&lt;/li&gt;
&lt;li&gt;Tx power is set as an option when intializing the advertisments. See&amp;nbsp;&lt;a title="sd_ble_gap_tx_power_set" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_1_2_1_2_35#ga0f1931af876bef39520c58de5ac060ca"&gt;sd_ble_gap_tx_power_set&lt;/a&gt;&amp;nbsp;API docs.&amp;nbsp;&lt;br /&gt;Be careful when using RSSI, it measures only the energy in the receiver when a packet is received, not link quality or the distance from transmitter, etc.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133506?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 18:47:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8f9aa59-e8f6-442a-8033-e272f74fa0c6</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I had a similar issue with the SAADC consuming a similar current after use; I use this sequence to close the SADDC with good results; perhaps try replacing your SAADC abort/uninit with this to see if it helps.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_saadc_task_trigger(NRF_SAADC_TASK_STOP);
    nrf_saadc_event_clear(NRF_SAADC_EVENT_STARTED);
    nrf_saadc_event_clear(NRF_SAADC_EVENT_END);
    // Disable command
    nrf_saadc_disable();
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133503?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 17:35:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:653ad883-cc13-4a63-a3f4-651669b151e3</guid><dc:creator>nick7</dc:creator><description>&lt;p&gt;Hey H&amp;aring;kon&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;1. I don&amp;#39;t think it&amp;#39;s possible to set breakpoints while Softdevice is running. So I read out the register values using log:&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;SAADC&lt;/strong&gt; I read out the ENABLE register value (at 0x40007500). This bit starts at 0 in phase 1 and returns to 0 in phase 3.&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;PPI&lt;/strong&gt; I read out the CHEN values (at 0x4001f500). CH31 is enabled the whole time, I think it&amp;#39;s used for the softdevice. CH0 starts out at 0 in phase 1 and returns to 0 in phase 3.&lt;/p&gt;
&lt;p&gt;Regarding the &lt;strong&gt;TIMER,&lt;/strong&gt; I did not know which register value to check. I could not find any changes in the CC[0], INTENSET, INTENCLEAR or MODE registers (all values 0 in all phases). However, when checking the BITMODE register it got a change in the register from 00 to 11 upon entering phase 2. This change was present for phase 3 as well. Which leads me to believe that maybe the timer was not correctly uninitialized. I observed similar behavior for the EVENTS_COMPARE[0] register (phase 1 = 0, phase 2 and 3 != 0).&lt;/p&gt;
&lt;p&gt;2. How should I read out the TX power? via the nRF connect app I get values between -50dBm and -70dBm.&lt;/p&gt;
&lt;p&gt;I attached the hex. files. Thanks for taking a look.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3240.ble_5F00_app_5F00_template_5F00_pca10040_5F00_s132.hex"&gt;devzone.nordicsemi.com/.../3240.ble_5F00_app_5F00_template_5F00_pca10040_5F00_s132.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart_5F00_c_5F00_pca10040_5F00_s132.hex"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_5F00_c_5F00_pca10040_5F00_s132.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The peripheral one is ble_app_template (this is the one with the power consumption issue). The other application is the central.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding nRF 52832 power consumption SAADC/PPI/TIMER</title><link>https://devzone.nordicsemi.com/thread/133454?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 14:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6df244d9-a4cb-4841-956a-a18d9a76bf8e</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Nick7,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Can you enter a debug session and read the registers of the peripherals you&amp;#39;re using, when you should normally be at sleep? For Phase 1 and Phase 3.&lt;/li&gt;
&lt;li&gt;&lt;br /&gt;Phase 1: Advertising interval of ~200ms should use ~70µA at 0dBm TX output. What is your TX output?&lt;br /&gt;Phase 2: It depends on how much CPU time the compression uses.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;We need more information on what exactly your current consumption issues are before we can point to anything specific.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;#39;d like to measure the current on a nRF52DK, do you mind sharing a hex file i can test?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>