Genesis
Joined: 15 Jan 2006
Posts: 28
|
|
Posted: 18 January 2006, 4:16 AM Post subject: Power optimization (sleep mode, effect on code, etc) |
|
|
Any hints on doing this without having everything go down the chute?
There's a reference to it in the docs but it says "See the ATMEL processor documentation for more information."
Here's what I'm trying to accomplish....
I have an application that runs off a set of NiMH batteries. Battery life is an issue. When the application is "idle", I would like the system to go to sleep to the greatest possible extent, waking up every few seconds to check and see if conditions exist that merit it "coming online."
I have soft power control of the peripheral regulator of a ZX pin, so I can shut down essentially all off-chip power draw. The ZX's regulator won't do for this purpose, so I'll need to add a second regulator just for the ZX with appropriate low standby current and LDO characteristics - that I can deal with as its not a huge change to the PCB that I was using for the Parallax parts (their on-chip reg works fine for this.)
Ok, so the application sees a circumstance where it can "sleep." I want to be able to put the processor in a low-power mode where it basically hibernates until a specific amount of time passes (a couple of seconds._ I can handle this needing to be triggered off an external signal (I have a DS1307 on the board with a square wave output I can potentially use for this purpose) although an internal wakeup is even better, since the longest time period on the DS1307 has a period of 1Hz. The chip would then wake up, resume processing long enough to check the conditions that allowed it to sleep in the first place, and if they're still present, go back to hibernation. It requires ~20ms for the ADC I'm using to stabilize its voltage references once it powers back up, so this means if I wake up every 2 seconds I am "awake" for 50ms out of every 2 seconds or so, or 2.5% of the time. This cuts a 60ma idle power consumption budget (chip + peripherals) down to 1.5ma on average, which gives me almost the battery pack's internal self-discharge time in "sleep mode."
Any hints or pointers on how to accomplish this? The ZX is a great chip - but its too power hungry to leave "up" all the time if it can put itself to sleep...... |
|
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 18 January 2006, 5:16 AM Post subject: |
|
|
There are several different power saving modes that have different characteristics. I suspect that "Power-down Mode" may be your best bet for the most power-use reduction. However, since it halts the main CPU clock, it also takes the longest to get the CPU running again.
Table 14 in the mega32 manual shows the wake-up sources and and which clocks are running for the various sleep modes. Following that table, there is extensive discussion of how to prepare for minimum power use. I believe that you would be well-served to read that discussion. |
|