
Originally Posted by
Gusse
Are you sure that your PIC is not damaged?
Sound strange that current consumption gets higher when IO's are changed to inputs. I have used this very successfully. During sleep mode, only current consumption that I can see, comes from low dropout 5V regulator.
I think this is only way to put PIC into sleep for undefined period.
Code:
<code><font color="#008000">@ sleep
</font></code>
or
Code:
<code><font color="#000000"><b>ASM
</b><font color="#008000">sleep
</font><b>ENDASM
</b></code>
BR,
-Gusse-
morning Gusse and everyones thank you for helping me .i just wake up and foundout that pic has short of 600 ohm between vcc and gnd i changed the pic the same f913 and sleep mode down to 0.063mA ,and this is my code example thank you again everyone here trying to help .
Code:
Include "modedefs.bas"
@ DEVICE WDT_OFF, PWRT_OFF,MCLR_OFF,CPD_OFF, BOD_OFF, PROTECT_OFF,INTRC_OSC_NOCLKOUT
ANSEL = %00000000
VRCON.7 = 1
CMCON0=%00000111
'WDTCON = %00010110
WDTCON.0 = 0
WDTCON.4 = 3
OPTION_REG.7 = 1
ADCON0.0 = 0
OSCCON.6 = 7
LCDCON.4=0
LCDCON.6=1
LCDCON.7=0
CMCON1 = 7
intcon = 0
PCON.4 = 0
PORTB =%00000001
TRISB = %00000001
PORTA = 0
TRISA = 0
PORTC = 0
TRISC = 0
G VAR BYTE
H VAR BYTE
L VAR BYTE
K VAR BYTE
NOTE VAR BYTE
BUZ VAR PORTB.3
MAIN:
G = G + 1
IF G => 30 THEN slp
HIGH PORTB.4
PAUSE 100
IF PORTB.0 = 0 THEN SLP
LOW PORTB.4
PAUSE 1000
IF PORTB.0 = 0 THEN SLP
GOTO MAIN
SLP:
OPTION_REG.7=0
HIGH PORTB.2
PAUSE 1000
LOW PORTB.2
INTCON.1 = 0
INTCON.4 = 1
@ SLEEP
@ NOP
PAUSE 100
HIGH PORTB.2
PAUSE 1000
LOW PORTB.2
g = 0
GOTO MAIN
END
Bookmarks