Hey All,
I am working on a board that is based on the nrf51422. The system goes to sleep and gets woken by an interrupt. One of the programmers claims to have managed sleep current in the tens of uA. I have inconsistently been able to achieve around 370uA. It only works sometimes. Most of the time it does not seem to go to sleep at all and remains in the low mA range. No, the current is not my debugger in case someone may be thinking this.
Here is an attempt at testing sleep. I configure a bidirectional master, open the channel and then immediately try to go to sleep.
int main(void)
{
uint8_t state=0;
uint8_t ant_channel;
// Enable SoftDevice.
uint32_t err_code;
err_code = sd_softdevice_enable(NRF_CLOCK_LFCLKSRC_XTAL_50_PPM,
softdevice_assert_callback);
APP_ERROR_CHECK(err_code);
timer0_init();
LED_R_Flash_50ms(1);
nrf_gpio_pin_clear(LED_R);
ant_channel_tx_broadcast_setup(CHANNEL_0);
err_code = sd_ant_channel_open(CHANNEL_0);
sd_power_mode_set ( NRF_POWER_MODE_LOWPWR );
for (;;)
{
switch(state)
{
case 0:
global_err_code=sd_ant_channel_close (CHANNEL_0);
if(global_err_code==NRF_SUCCESS)
state=1;
break;
case 1:
LED_G_Flash_20ms(10);
NVIC_DisableIRQ(TIMER0_IRQn);
NRF_TIMER0->TASKS_STOP = 1; // Start clocks
__WFI();
break;
}
}
}
Our actual application uses a gpio to wake from either a button press of an accelerometer.
Any help or example code would be greatly appreciated. I LOVE THIS SOC!!! but I am hitting a roadblock as battery life is crucial.
My setup: Keil MDK 5.1, nrf51422 QFaa, nrf51 sdk version 4.2.2,
Thanks, Dustin