Welcome! Log In Create A New Profile

Advanced

Does bypic have low power mode / sleep mode ?

Posted by ls7u 
Does bypic have low power mode / sleep mode ?
August 04, 2016 06:49PM
Hi ,

Im planning on using a bypic for a battery powered project and want to save as much power as possible. Is it possible put the micro in power saving mode ie. sleep for a bit and then wake up and do something then go to sleep to save power ?

Thanks
Luke
Re: Does bypic have low power mode / sleep mode ?
August 04, 2016 07:08PM
yes it is:
powersave(1)

Everything stops except the watchdog timer so there are only 2 ways to get it going again reset or a watchdog timeout, it was used in the BV508 server here:


// watch dog for power down control
constant WDTCLR         0xBF800004
constant WDTSET         0xBF800008 // wdtcomset
constant WDSW           (1 << 15)
constant WDCLR          1


// *****************************************************************************
// client function talkes to a webserver
// *** Before starting this will need connecting to an existing access point
//     using join and the wi-fi initialising
// *****************************************************************************
function HTTPclient()
/// --------- snippet -----------------
// gives 30 seocnds ( 2 x watchdog) - whatchdog is fixed at about 16 seconds and can't be changed

        @WDTSET = WDSW // turn on watch dog (about 16 sec)
        for j = 1 to 2
            powersave(1) // sleep mode for CPU (about 15-16 sec)
        next

        // arrive here after 30 seconds
        @WDTCLR = WDSW // watchdog off

endf
Re: Does bypic have low power mode / sleep mode ?
August 05, 2016 03:33PM
Jim ,

Thanks that was exactly what i was looking for .


so... will be 60secs be... ??
  for j = 1 to 4
            powersave(1) // sleep mode for CPU (about 15-16 sec)
        next




Lastly is there any max time ? could it be exended to an hour ?


Many thanks
Luke
Re: Does bypic have low power mode / sleep mode ?
August 06, 2016 09:46AM
yes,
approximately watchdog timeout time is not exactly 16 seconds
Sorry, you do not have permission to post/reply in this forum.