<?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>ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95352/adc-current-consumption-is-3-to-4ma-even-in-datasheet-it-is-700ua</link><description>Hello, 
 I m using nRF 52832 with SDK 15.0.0 . 
 when i m measuring current for adc it showing about 3-4 mA . 
 but from datasheet of nrf52832 its showing 700 uA . 
 
 my code steps are: 
 saadc_init(); // SAR adc initialisation_Channel 0_12bit resolution_VDD</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Jan 2023 14:42:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95352/adc-current-consumption-is-3-to-4ma-even-in-datasheet-it-is-700ua" /><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/405511?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2023 14:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58ff9a2f-368c-4538-940a-2b36c8181686</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;So I think I&amp;#39;ve misunderstood you previously, I&amp;#39;m, sorry for that.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve measured with your hex and can confirm that I measure about 3 mA on my development kit. I&amp;#39;m not sure why you&amp;#39;re measuring that high if the delay isn&amp;#39;t added which would mean that the program goes straight to&amp;nbsp;&lt;span&gt;nrfx_saadc_uninit, but I was able to get the current down to 16 µA by using the SAADC example in the nRF5SDK and modifying it a bit by un initializing&amp;nbsp;PPI, the SAADC and the Timer after 5 samples (see the code below).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But to your main question, I guess what you&amp;#39;re looking for is a low power SAADC example. Luckily, we already have this &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/blob/master/saadc_low_power/README.md"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I hope that helps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_saadc.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#define SAMPLES_IN_BUFFER 5
volatile uint8_t state = 1;

static const nrf_drv_timer_t m_timer = NRF_DRV_TIMER_INSTANCE(0);
static nrf_saadc_value_t     m_buffer_pool[2][SAMPLES_IN_BUFFER];
static nrf_ppi_channel_t     m_ppi_channel;
static uint32_t              m_adc_evt_counter;


void timer_handler(nrf_timer_event_t event_type, void * p_context)
{

}


void saadc_sampling_event_init(void)
{
    ret_code_t err_code;

    err_code = nrf_drv_ppi_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
    err_code = nrf_drv_timer_init(&amp;amp;m_timer, &amp;amp;timer_cfg, timer_handler);
    APP_ERROR_CHECK(err_code);

    /* setup m_timer for compare event every 400ms */
    uint32_t ticks = nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer, 400);
    nrf_drv_timer_extended_compare(&amp;amp;m_timer,
                                   NRF_TIMER_CC_CHANNEL0,
                                   ticks,
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);
    nrf_drv_timer_enable(&amp;amp;m_timer);

    uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&amp;amp;m_timer,
                                                                                NRF_TIMER_CC_CHANNEL0);
    uint32_t saadc_sample_task_addr   = nrf_drv_saadc_sample_task_get();

    /* setup ppi channel so that timer compare event is triggering sample task in SAADC */
    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_ppi_channel_assign(m_ppi_channel,
                                          timer_compare_event_addr,
                                          saadc_sample_task_addr);
    APP_ERROR_CHECK(err_code);
}


void saadc_sampling_event_enable(void)
{
    ret_code_t err_code = nrf_drv_ppi_channel_enable(m_ppi_channel);

    APP_ERROR_CHECK(err_code);
}


void saadc_callback(nrf_drv_saadc_evt_t const * p_event)
{
    if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)
    {
        ret_code_t err_code;

        err_code = nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);

        int i;
        //NRF_LOG_INFO(&amp;quot;ADC event number: %d&amp;quot;, (int)m_adc_evt_counter);

        for (i = 0; i &amp;lt; SAMPLES_IN_BUFFER; i++)
        {
            NRF_LOG_INFO(&amp;quot;%d&amp;quot;, p_event-&amp;gt;data.done.p_buffer[i]);
        }
        m_adc_evt_counter++;
    }
}


void saadc_init(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_init(NULL, saadc_callback);
    APP_ERROR_CHECK(err_code);

    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);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);

}

void saadc_init(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_init(NULL, saadc_callback);
    APP_ERROR_CHECK(err_code);

    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);

    err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);

}


/**
 * @brief Function for main application entry.
 */
int main(void)
{
    //uint32_t err_code = NRF_LOG_INIT(NULL);
    //APP_ERROR_CHECK(err_code);

    //NRF_LOG_DEFAULT_BACKENDS_INIT();

    ret_code_t ret_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(ret_code);

    saadc_init();
    saadc_sampling_event_init();
    saadc_sampling_event_enable();
    //NRF_LOG_INFO(&amp;quot;SAADC HAL simple example started.&amp;quot;);

    while (1)
    {

        if(m_adc_evt_counter &amp;gt;= 5)
        {
          nrf_drv_ppi_channel_disable(m_ppi_channel);
          nrf_drv_saadc_uninit();
          nrf_drv_timer_uninit(&amp;amp;m_timer);
        
        }
        nrf_pwr_mgmt_run();
        //NRF_LOG_FLUSH();
    }
}

&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/405362?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2023 05:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9104fd8d-8bbb-466c-a878-8cdb316a22ee</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;Yes.&lt;/p&gt;
&lt;p&gt;we are using custom board .&lt;/p&gt;
&lt;p&gt;Can you share any snap of that .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/405237?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 12:41:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf827b89-2bd9-4313-aab2-c1983e08871d</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I used the PPK2 and a development kit and configured the device and PPK in source mode. Yes, I measured 700 µA.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Are you using a custom board or development kit?&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: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/405047?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 13:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ee6d87a-ca14-425c-bf18-4ab7e2493ff1</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;how you measured current?&lt;/p&gt;
&lt;p&gt;how you said its 700uA???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/405045?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 13:18:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9bd3b6e-06f2-4707-92d0-d63344fedfa4</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;yes.&lt;/p&gt;
&lt;p&gt;there is no delay function in code for current measuring .I already removed from code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/404391?ContentTypeID=1</link><pubDate>Wed, 11 Jan 2023 15:34:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3fdabea-bfe1-4a8f-a4f6-358b9319a9cb</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I measured about 700 µA with the hex that you shared. Did you remove the delay before sending me the hex? 3-4 mA is expected if nrf_delay_ms(5000) is used because the CPU will just spin in a loop for 5 seconds.&amp;nbsp;&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><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/403579?ContentTypeID=1</link><pubDate>Fri, 06 Jan 2023 12:49:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d71846b-a066-43cd-925e-227017cf785e</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/saadc_5F00_lowpower.hex"&gt;devzone.nordicsemi.com/.../saadc_5F00_lowpower.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have attached hex file for your reference. Please check it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/403321?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 09:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc3bc73d-ee54-4e7c-a673-9d6f8cd15420</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;Actually power profiler is not with us.so we are measuring&amp;nbsp; current through multimeter itself.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/403305?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 08:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a380f800-50b0-4fee-8995-04e308acf62a</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Why would you need to add the delay to measure the current? What does the current change to if you remove the delay?&lt;/p&gt;
&lt;p&gt;Can you share a pre compiled hex that I can flash to my nRF52 development kit so I can verify the measurement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;br /&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/403285?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 05:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1912bb7-08f6-4c39-b311-91cc3376ab99</guid><dc:creator>Embel_Tech</dc:creator><description>&lt;p&gt;YES.&lt;/p&gt;
&lt;p&gt;As i&amp;nbsp;am measuring current by multimeter with below function, delay is added here to capture current value on multimeter.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;saadc_init(); // SAR adc initialisation_Channel 0_12bit resolution_VDD as input.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nrf_saadc_value_t adc_val;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nrfx_saadc_sample_convert(0,&amp;amp;adc_val);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nrf_delay_ms(5000);&amp;nbsp; &amp;nbsp; &amp;nbsp; // added for current measurement&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nrfx_saadc_uninit();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also tried&amp;nbsp;&lt;span&gt;nrfx_saadc_abort(), and wait for NRFX_SAADC_EVT_DONE&amp;nbsp; .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but getting same&amp;nbsp; current about 3- 4mA.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC CURRENT CONSUMPTION IS  3 TO 4mA, even in datasheet it is 700uA</title><link>https://devzone.nordicsemi.com/thread/403222?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 15:10:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15344d18-ff2c-4183-99ca-04c521289677</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;How are you measuring the current?&lt;/p&gt;
&lt;p&gt;Can you try to call nrfx_saadc_abort(), and wait for NRFX_SAADC_EVT_DONE event before you call&amp;nbsp;&lt;span&gt;nrfx_saadc_uninit()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>