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

1mA active mode troubleshooting

Hi,

We have a rev3 nrf51822 system running S110 v7.3 and using SDK6.1.0. We are having trouble tracking down a ~1mA baseline current consumption when in system on/low power mode. Going to System Off mode reduces current to ~12uA. We can see with a scope that there is a ~1mA constant baseline otherwise.

We've looked at devzone.nordicsemi.com/.../ and various other posts, and it seems like something is keeping the internal RC HFCLK active (we can see on the scope that the external 16MHz xtal is only active during radio transmission.)

This is not a debugger-related issue as it persists after the debugger is disconnected and the system is power-cycled.

This problem happens with or without a bootloader, so it's not this problem.

We've tried disabling the various peripherals that are in use in our system but still have this 1mA baseline.

We have also run the HRM example (modified slightly for our board) and see reasonable current consumption (~200uA during connection).

How can we determine exactly what is keeping the clock running, if that is the problem? We've tried for example the method below, but none of the flags are set. Is there any way to determine for certain that the internal RC 16MHz clock is running?

Any help appreciated.

loren

#define PWR_REQ_UART 	(1<<0)
#define PWR_REQ_SPIS 	(1<<1)
#define PWR_REQ_SPI0	(1<<2)
#define PWR_REQ_SPI1	(1<<3)
#define PWR_REQ_TWI0	(1<<4)
#define PWR_REQ_TWI1	(1<<5)
#define PWR_REQ_GPIOTE	(1<<6)
#define PWR_REQ_ADC		(1<<7)
#define PWR_REQ_TIMER0	(1<<8)
#define PWR_REQ_TIMER1	(1<<9)
#define PWR_REQ_TIMER2	(1<<10)
#define PWR_REQ_TEMP	(1<<11)
#define PWR_REQ_RNG		(1<<12)
#define PWR_REQ_ECB		(1<<13)
#define PWR_REQ_QDEC	(1<<14)
#define PWR_REQ_CONSOLAT (1<<15)
/**
 * Check all possible sources that can keep the HFCLK active.
 * See Table 33 on pp. 48 of PSv3.1 for
 * list of peripherals that can request the clock.
 * \return flags indicating which sources are active
 */
uint32_t pwr_check(void)
{
	uint32_t pwr_reqs = 0;

	if (NRF_UART0->ENABLE)
		pwr_reqs |= PWR_REQ_UART;

	if (NRF_SPIS1->ENABLE)
		pwr_reqs |= PWR_REQ_SPIS;

	if (NRF_SPI0->ENABLE)
		pwr_reqs |= PWR_REQ_SPI0;

	if (NRF_SPI1->ENABLE)
		pwr_reqs |= PWR_REQ_SPI1;

	if (NRF_TWI0->ENABLE)
		pwr_reqs |= PWR_REQ_TWI0;

	if (NRF_TWI1->ENABLE)
		pwr_reqs |= PWR_REQ_TWI1;

	if (NRF_GPIOTE->TASKS_OUT[0])
		pwr_reqs |= PWR_REQ_GPIOTE;
	if (NRF_GPIOTE->TASKS_OUT[1])
		pwr_reqs |= PWR_REQ_GPIOTE;
	if (NRF_GPIOTE->TASKS_OUT[2])
		pwr_reqs |= PWR_REQ_GPIOTE;
	if (NRF_GPIOTE->TASKS_OUT[3])
		pwr_reqs |= PWR_REQ_GPIOTE;

	if (NRF_ADC->ENABLE)
		pwr_reqs |= PWR_REQ_ADC;

//	Can we check if the timers are running
	//PWR_REQ_TIMER0	
	//PWR_REQ_TIMER1	
	//PWR_REQ_TIMER2	

	// Temp is a one-shot, so probably not an issue, also not clear if we can read back
	//PWR_REQ_TEMP	

	// Unclear if there's a way to read the power states of these back?
	//PWR_REQ_RNG		
	//PWR_REQ_ECB

	if (NRF_QDEC->ENABLE)
		pwr_reqs |= PWR_REQ_QDEC;

	if (NRF_POWER->TASKS_LOWPWR)
		pwr_reqs |= PWR_REQ_CONSOLAT;

	return pwr_reqs;
}
Parents Reply Children
No Data
Related