Hi there,
Any changes that you could share applications schematics with us?
Do you have discrete pull-ups or pull-downs connected to PIC IO's?
Is PIC only active part of the system?
BR,
-Gusse-
Hi there,
Any changes that you could share applications schematics with us?
Do you have discrete pull-ups or pull-downs connected to PIC IO's?
Is PIC only active part of the system?
BR,
-Gusse-
hello . i have pic16f913 no pull up resistance external,i have a buzzer with 2 transistor but i take them off when the pic in sleep mode i test the current still 5.9 mA in sleep mode it goes up when wake up between 32 to 65 mA, 1 bottom in portb.0 for interrupt wakeup , and 2 leds i take them off but no change .here is my code example .nothings pluged in the ic external . im confused ..?im sure something in the registers or timers i donno how to set timers
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 'CVref circuit powered down (VREN bit)=save power CMCON0=%00000111 'WDTCON = %00010110 WDTCON.0 = 0 WDTCON.4 = 3 OPTION_REG.7 = 1 ' i tryed this =0 but the same problm 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 LOW PORTB.4 PAUSE 1000 GOTO MAIN SLP: OPTION_REG.7=0 'INTCON.0 = 0 'RBIF 'INTCON.3 = 1 'RBIE INTCON.1 = 0 INTCON.4 = 1 @ SLEEP @ NOP PAUSE 100 HIGH PORTB.2 PAUSE 1000 LOW PORTB.2 GOTO MAIN END
Last edited by Mus.me; - 15th November 2009 at 14:26.
How much is the consumption when you press and hold the button (portb.0) ?
How about by changing all pins to inputs before sleep?
Any effects?Code:<code><font color="#000000">SLP: OPTION_REG.7=0 <font color="#000080"><i>'INTCON.0 = 0 'RBIF 'INTCON.3 = 1 'RBIE </i></font>INTCON.1 = 0 INTCON.4 = 1 TRISA = %11111111 TRISB = %11111111 TRISC = %11111111 <font color="#008000">@ SLEEP @ NOP </font>TRISA = %00000000 TRISB = %00000001 TRISC = %00000000 <b>PAUSE </b>100 <b>HIGH </b>PORTB.2 <b>PAUSE </b>1000 <b>LOW </b>PORTB.2 <b>GOTO </b>MAIN</code>
BR,
-Gusse-
I don't use the @ SLEEP command.
I use PBP SLEEP xxx to get a delay and low power.
HTH
BrianT
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.
orCode:<code><font color="#008000">@ sleep </font></code>
BR,Code:<code><font color="#000000"><b>ASM </b><font color="#008000">sleep </font><b>ENDASM </b></code>
-Gusse-
Last edited by Gusse; - 16th November 2009 at 08:12.
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
Last edited by Mus.me; - 16th November 2009 at 08:26.
Bookmarks