Wait for Event / Best Idle state

boron
argon
xenon
Tags: #<Tag:0x00007fe21e2ec6d0> #<Tag:0x00007fe21e2ec590> #<Tag:0x00007fe21e2ec428>

#1

For Gen 3 devices what are people using for an idle state?
My battery application requires reasonably quick response <1min but i also need to be power conscious.
It seems the deep sleep stuff requires long periods to reconnect and misses many cloud functions.

Can I use the usual ARM Wait For Interrupt (__WFI) or Wait For Event (__WFE) to reduce power just a bit? Or is this already part of the RTOS?


#2

take look at this thread

It covers a lot of ground and the last post provides power savings of the varies modes


#3

I did some tests to see what would happen. Using a 10s average though a 1ohm resistor on the LI+ I got the following results:

SYSTEM_MODE(MANUAL);

void setup() {
    RGB.brightness(0);
}

void loop() {
    // Enter System ON sleep mode
    __WFE();
}

Without the Wait code: (3.96V x 4.07mA) 16.12mW
With the Wait code: (3.96V x 1.48mA) 5.86mW

I’m really surprised this isn’t already in the RTOS idle task. Anyway. hope this helps people get more battery life without sacrificing response.


#4

Does this maintain particle cloud connection in this state?


#5

So far it seems a bit sketchy. The WFE seems to mess with obtaining a cloud connection. But once connected its seems ok. Reponds to pings and functions as normal.

I might not both for the 8mW of power savings the potential for problems is too much. I think a wait stop needs to be incorporated to the RTOS idle task for less obtrusion.

Using this sketch on an idling boron I got these results over 60s average.
Without the Wait code: (3.92V x 48mA) 188.16mW
With the Wait code: (3.92V x 46mA) 180.3mW

SYSTEM_THREAD(ENABLED);

LEDSystemTheme theme; // Enable custom theme

void setup() {
    theme.setColor(LED_SIGNAL_CLOUD_CONNECTED, 0x00000000); // Set LED_SIGNAL_NETWORK_ON to no color
	theme.apply(); // Apply theme settings 
}

void loop() {
    if(Particle.connected() && millis() > 60000){
        //__WFE();
    }
}