This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Strange current spikes in nRF52 with RTC only

Hi, currently I'm working on ultra low power device. This device need to be wake up in 333 ms interval. I use RTC for this. My question is about strange current spikes with i observed on Nordic Power Profiler Kir ( nRF6707 ). What is a source for this spikes?

print screen

This spikes have interval ~25ms. Average current looks quite OK: System on ( 1.2uA)+ RC ( 1uA ) + RTC ( 0.1 uA ) = 2.3 uA I'm not use any soft device. I use internal RC clock source for LFC.

My code is very simple: main:

int main(void)
{	
  NRF_POWER->DCDCEN = 1;
  lfclk_config();               
  rtc_config();
  
  while (1)
  {
		power_manage();	
  }
}

rtc_config:

static void rtc_config(void)
{
	uint32_t err_code;

	nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
	config.prescaler = 64; // 32 768 Hz / 38 = 1024 Hz
	err_code = nrf_drv_rtc_init(&rtc, &config, rtc_handler);
	APP_ERROR_CHECK(err_code);
	nrf_drv_rtc_cc_set(&rtc,0, MEASURMENT_TIME_MS, true);
	nrf_drv_rtc_counter_clear(&rtc); 
	
	nrf_drv_rtc_enable(&rtc);
}

RTC handler, power manage and lfck config:

#define MEASURMENT_TIME_MS 333 
const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(2); 

static void rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
  if (int_type == NRF_DRV_RTC_INT_COMPARE0)
  {					
    nrf_drv_rtc_cc_set(&rtc,0, MEASURMENT_TIME_MS, true);		
    nrf_drv_rtc_counter_clear(&rtc); 
  }
}

static void power_manage( void )
{
	// WFE - SEV - WFE sequence to wait until a radio event require further actions.
	__WFE();
	__SEV();
	__WFE();
}

static void lfclk_config(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_clock_lfclk_request(NULL);
}

Does anyone know what could be the source of this spikes? RC temperature corecction? Nordic power profiler kit bug?

Parents
  • Hi,

    Those short spikes are probably due to the nRF52's power supply working in ref refresh mode. Here is a quote from the current measurement guide:

    The nRF52 power supply uses auto-controlled refresh modes to maximize efficiency. What this basically means is that a capacitor is recharged regularly to provide power to the chip. The recharge off the capacitor happens during a very short time interval, and results in a high frequency peak in current. This peak is measured to be about 10 - 15 us long. In order to get the correct average current during these peaks, a sampling frequency corresponding to half the peak length is required. This results in a minimum frequency of 200k samples per second (1 sample every 5 us).

    BTW, aren't your RTC intervals closer to ~650ms? With a prescaler of 64 and a compare register value of MEASURMENT_TIME_MS = 333, you will get a f_RTC 32.768 / (64 + 1) = ~504 and hence, an interval of 333/504 = ~660ms.

Reply
  • Hi,

    Those short spikes are probably due to the nRF52's power supply working in ref refresh mode. Here is a quote from the current measurement guide:

    The nRF52 power supply uses auto-controlled refresh modes to maximize efficiency. What this basically means is that a capacitor is recharged regularly to provide power to the chip. The recharge off the capacitor happens during a very short time interval, and results in a high frequency peak in current. This peak is measured to be about 10 - 15 us long. In order to get the correct average current during these peaks, a sampling frequency corresponding to half the peak length is required. This results in a minimum frequency of 200k samples per second (1 sample every 5 us).

    BTW, aren't your RTC intervals closer to ~650ms? With a prescaler of 64 and a compare register value of MEASURMENT_TIME_MS = 333, you will get a f_RTC 32.768 / (64 + 1) = ~504 and hence, an interval of 333/504 = ~660ms.

Children
No Data
Related