Sleep mode not functionning
Hi,
I am trying to use the sleep command (assembler way) with and without the LCD as shown in my code. Either way it does not seem to work because without the LCD I always get 22mA from my 12v batteries and with the LCd module about 85mA . Can someone tell me why the sleep command do not work.
I know I dont have any interrupt to get out of sleep, but first thing first
Thanks
ken
Code:
'using a pic16F88
' MPASM Header
INCLUDE "modedefs.bas"
OSCCON = %01110000 '8 Mhz
Define OSC 8
'///////////////////////////
'// Interrupt section //
'///////////////////////////
'ON INTERRUPT Goto MyInterrupt
' INTCON = %10010000
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
'/////////////////////////
'// LCD configuration //
'/////////////////////////
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
DEFINE LCD_RSBIT 4 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTA ' Set LCD Enable port
DEFINE LCD_EBIT 7 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
DEFINE CHAR_PACING 2000
pause 500
Mainloop:
lcdout $FE,1, "Test: ", dec 22
PAUSE 3000
@sleep
goto Mainloop
end
Re: Sleep mode not functionning
I read in a post that I needed to chang the GIE in the INTCON register.. so I did with no luck:
INTCON.7 = 0 ' GIE = 1
INTCON.4 = 1
@ sleep
Re: Sleep mode not functionning
Hi, Ken
When talking about sleep mode current draw ...
a full scheme AND full code of the project are highly necessary ...:surprise:
Alain
PS : I already bet 10 mA for your 12v/5v regulator ....
Re: Sleep mode not functionning
Problem solved by a phone call ;)