You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • Errata: ...but keep reading... bottom line: output GPIO pins are still driven, even in deep-sleep.


    I don't think it is so natural... deep sleep mode switches off the outputs.

    The part 'deep' makes it natural...:

    Looking at the datasheet, deepsleep vs just sleep does what it says: deep sleep (called stop mode vs sleep mode) switches everything off but (one single?) internal timer (and connection to input) for the wake up. If a pin gate is not driven, it floats... otherwise one would not get down to the desired power savings with consumption of microAmps only.

    Even when the deep sleep is not enabled, Espruino - when done with an execution phase - already goes - by its intended architectural nature - into sleep mode - a sleep mode with all the peripherals still powered.

    Every code execution phase is actually just an interrupt handling - and that makes Espruino event driven. The processor is busy only after a power on event, timer event, input pin event, or I/O-subsystem event. That is what makes Espruino conceptionally totally different from Arduino and a-like for programming. There is no infinite execution loop...

    The setDeepSleep() sets a flag, which is checked when the Espruino JS interpreter is done with handling the interrupt. If deep sleep is enabled, Espruno JS interpreter commands the processor into a stop mode (there are various run modes, sleep modes, stop modes, and even a - Espruino not used - standby mode). Check out pages 26 and 67 and previous ones of Pico's datasheet and page 48 and around of Espruino original board's datasheet.

    @Gordon can tell us off the bat which one he has chosen for the sleep and deep sleep modes for Espruino. The Power Consumption page is not that specific... and your observations contradict the example: I'm not sure if it is correct (any more), because you measured 3ms flashes only, where the example uses 20 ms and the page says that you should be able to have flashes up to 1.5 sec (pending callback), because that's the deep sleep entry/timer cycle/interval. May be the sample was tested and it flashed... worked! ...sort of... because who can say by the naked eye if it is 3ms or 20ms... or was the flash time measured with an oszi? ;-)

    With some extra (peeking and) pooking you may tweek the processor in a '@Stevie sleep mode' - the way serves your needs and affordable by the chosen battery.

    @Gordon - 2 things:

    • I did not see a link to Pico's datasheet on Pico's board reference page (yet). Standard board reference page has that convenience.
    • On power consumption page - under stop mode - the last item just says 'before sleeping' and is confusing, because it means 'before deep sleping:

    All external peripherals (including timers for PWM) will stop. Espruino does not currently detect if any of these timers are in use before sleeping.

About

Avatar for allObjects @allObjects started