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

system-on-wakeup-on-rtc sleep code, why the current is 3mA?

The test code:

#include "nrf51.h"
int main(void) {
NRF_CLOCK->LFCLKSRC = 0UL;	// Internal 32kHz RC

// Start the 32 kHz clock, and wait for the start up to complete
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while(NRF_CLOCK->EVENTS_LFCLKSTARTED == 0);

// Configure the RTC to run at 2 second intervals, and make sure COMPARE0 generates an interrupt (this will be the wakeup source)
NRF_RTC1->PRESCALER = 0;
NRF_RTC1->EVTENSET = 0x1UL;
NRF_RTC1->INTENSET = 0x1UL;
NRF_RTC1->CC[0] = 10*32768;
NVIC_EnableIRQ(RTC1_IRQn);

        // Start the RTC timer
        NRF_RTC1->TASKS_START = 1;

            // Enter System ON sleep mode
            __WFE();
            // Make sure any pending events are cleared
            __SEV();
            __WFE();

        // Stop and clear the RTC timer
//	NRF_RTC1->TASKS_STOP = 1;
//	NRF_RTC1->TASKS_CLEAR = 1;
}

void RTC1_IRQHandler(void)
{
// This handler will be run after wakeup from system ON (RTC wakeup)
if(NRF_RTC1->EVENTS_COMPARE[0]) {
    NRF_RTC1->EVENTS_COMPARE[0] = 0;
    NRF_RTC1->TASKS_CLEAR = 1;
}
}

Any advice? datasheet says the RTC current should be 0.1uA....

Parents
  • I have nRF51422-QFAA E00 + SD310v1.0 + SDK5.2.0

    When I go to SystemOff consumption of entire PCB is 5.3uA

    When I just call sd_app_evt_wait(); and close radio + DisableHFclock + disable all perihperals I was using consumption is about 350uA. Only I have active is sensing NRF_GPIOTE->EVENTS_PORT through GPIOTE_IRQHandler(). According to PS current consumption should be just about 1uA higher in System ON compared to System OFF.

    When I'm in sleep mode with System ON I'm in a loop

    while(U8_SoC_flag_sleep == 1){
    	sd_app_evt_wait();				
    	V_hw_wdg_reload();
    	 if(sd_evt_get(pid) == NRF_SUCCESS){
    		 tmo = *pid;
    	 }
    
    }
    

    I'm trying to find out which event caused wake-up, by debugger I got this ID: 0x200026A4

    But I can't find list of event values to find out which peripheral is causing this. Anyway another event is not generated so it's waiting for the next event which is IRQ caused by button which works OK, but meanwhile consumption is 350uA, why? Rest of board in this case consumes max. cca 60uA so it's definitely consumed by SoC.

Reply
  • I have nRF51422-QFAA E00 + SD310v1.0 + SDK5.2.0

    When I go to SystemOff consumption of entire PCB is 5.3uA

    When I just call sd_app_evt_wait(); and close radio + DisableHFclock + disable all perihperals I was using consumption is about 350uA. Only I have active is sensing NRF_GPIOTE->EVENTS_PORT through GPIOTE_IRQHandler(). According to PS current consumption should be just about 1uA higher in System ON compared to System OFF.

    When I'm in sleep mode with System ON I'm in a loop

    while(U8_SoC_flag_sleep == 1){
    	sd_app_evt_wait();				
    	V_hw_wdg_reload();
    	 if(sd_evt_get(pid) == NRF_SUCCESS){
    		 tmo = *pid;
    	 }
    
    }
    

    I'm trying to find out which event caused wake-up, by debugger I got this ID: 0x200026A4

    But I can't find list of event values to find out which peripheral is causing this. Anyway another event is not generated so it's waiting for the next event which is IRQ caused by button which works OK, but meanwhile consumption is 350uA, why? Rest of board in this case consumes max. cca 60uA so it's definitely consumed by SoC.

Children
No Data
Related