PDA

View Full Version : PIC18F4520 Sleep mode power consumption w Int & Ext Osc



Gusse
- 8th October 2009, 20:05
Hi All,

I have one PIC18F4520 application running at 40MHz (10MHz XTAL, 4x PLL). To get more IO's, I thought to run PIC with internal clock (8MHz, 4x PLL). Everything works perfectly, until I tested sleep mode.


</i></font><b>ASM
</b><font color="#008000">sleep
</font><b>ENDASM</b>
PIC goes to sleep, but current consumptions is much higher (~8x) than with 10MHz XTAL.
40MHz: 0.85mA (XTAL)
32MHz: 6.75mA (Int CLK)

Differences between codes:

<code><font color="#000000"><b>DEFINE </b>OSC 40
</code>

<code><font color="#000000"><b>DEFINE </b>OSC 32
OSCCON=%11111100
OSCTUNE.6=1
</code>

Differences in INC-file

__CONFIG _CONFIG1H, _OSC_HSPLL_1H

__CONFIG _CONFIG1H, _OSC_INTIO67_1H

Any ideas how to recude power consumption?
I tried to search forum and web, but no hits. Also I have read data sheet, but I was not able to find any help.

BR,
-Gusse-

Darrel Taylor
- 9th October 2009, 04:36
When a PIC goes into sleep mode, the primarary oscillator is shut-down (internal or external).
So it shouldn't matter what oscillator you are using.

And in sleep mode, a 4520 should only draw 10uA or less. (about 1/1000th of what you are reading).

Are you sure you didn't leave the WDT ON?
Any interrupts enabled?

There are several things you can turn off to get lower current in sleep mode, but none of them take 6 ma.
<br>

Bruce
- 9th October 2009, 06:16
Clear OSCCON.7 so you aren't in power managed mode with peripherals still clocked during sleep.

Darrel Taylor
- 9th October 2009, 06:23
Oh! Very nice.

I did not see that.

Good 1 Bruce.
<br>

Gusse
- 9th October 2009, 08:01
Thanks Bruce & Darrel, You are Awesome guys!

After clearing OSCCON.7 it goes again to low power mode sleep with int osc :)
0.85mA is system power consumption during PIC sleep. During sleep mode there are still several other parts, which consume power. Therefore value is so high.

BR,
-Gusse-