CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

enter sleep mode every second

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
danielz85



Joined: 22 Sep 2012
Posts: 37

View user's profile Send private message

enter sleep mode every second
PostPosted: Thu Feb 14, 2013 6:24 am     Reply with quote

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: 9207
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Feb 14, 2013 6:50 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group