power consumption is too high on my nrf52 SoC

Hi, 

I am currently trying to decrease my power output, for this purpose I used a power profiler and found this pattern:

I am using a test firmware that just disables all unused gpio ports, start ble and then goes into while(1){ __WFE();}

power consumption is never below 400uA, the spikes seem fine (BLE advertising spikes I presume).

s there anything you can tell me about why this would happen?

Even if I turn of BLE I still got 200uA on average, so some of the problem is probably in my configuration (but. already increased the adv intervals) and part of it is the chip by itself. I am using a custom PCB but am pulling down all GPIO ports

Best, Julius

Parents Reply Children
  • I actually noticed something while investigating, I used the following lines in my ble setup: 

      NRF_CLOCK->TASKS_HFCLKSTART  = 1;
      while ( NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);    
    

    and when commenting them , the average went down significantly (at least on the DK, I will test this on my custom PCB later). Though I think I included this because there was a problem with the SD but I cannot pinpoint what exactly it was. What are your thoughts on this?

  • still it looks like something is requesting air time every ms, the advertising event only occurs every 500ms as defined, thats whats so weird

  • Writing '1' to NRF_CLOCK->TASKS_HFCLKSTART will start the 32 MHz crystal oscillator, and the crystal oscillator is not automatically released in sleep. The run current with the oscillator active is about 200 uA. 

  • ok thanks so I will leave this out and I also found out that my saadc sampling is responsible for most of the drainage besides that. 

  • what do I need to do in this function to decrease the power consumption:

    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(&m_timer, &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(&m_timer, 400);
        nrf_drv_timer_extended_compare(&m_timer,
                                       NRF_TIMER_CC_CHANNEL0,
                                       ticks,
                                       NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                       false);
        nrf_drv_timer_enable(&m_timer);
    
        uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&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(&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);
    }
Related