danielz85
Joined: 22 Sep 2012 Posts: 37
|
enter sleep mode every second |
Posted: Thu Feb 14, 2013 6:24 am |
|
|
Hello,
I'm currently using dsPIC33FJ06GS202 and the only that it's doing in the while loop is output a signal to it's internal DAC @ 20MHz with an external xtal oscillator.
In order to save power I've decided that I will produce the signal for a second and then wait for one second and so on. In the waiting period I put the pic to sleep mode.
My question is, is this the right way to save power? or is switching the pic with all it's clocks and peripherals on and off is not a healthy solution?
this is what is says in the datasheet regarding sleep:
Quote: | Sleep mode stops clock operation and halts all
code execution. Idle mode halts the CPU and code
execution, but allows peripheral modules to continue
operation.
|
Thanks!
Daniel |
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Feb 14, 2013 6:50 am |
|
|
Microchip has a apnote about 'power saving,battery life,...' maybe 15 years ago which is a very good read...great place to start
While it sounds nice to go to sleep for 1/2 the time(1 second running, 1 second sleeping', you really won't save 1/2 of the battery life.There are 'operational' things to consider.Wakeup time(delays to get 'up to speed'),setup of SFRs,I/O pins, etc.
Run a few long term tests to see what the real current/power demands are,being sure to record 'all the numbers'.
Although you say your PIC only accesses the DAC for a second...projects grow,demanding more power....however if the program is 'done', no further changes, perhaps switching to another, far less 'complicated' or powerful PIC is a better option.After all you don't need a sledge hammer to drive in small nails!
Power reduction can also be had by turning off ALL unused peripherals, setting I/O pins off,disabling sec. osc, PLLs,etc.
You should also consider the R&D time($$$labour) to modify your code.I know,'it won't take that long....',then 4 dayze later your're still wondering WHY it doesn't run right.These high powered PICs have a LOT of fuses,options,peripherals to consider hence the 400-500 PAGES that is MUST reading!
The simplest option is of course to use a larger capacity battery!Costs only pennies more,but could easily get 3-10 times the runtime. |
|