Hi,Jerson
You're right ...
Code:
' Perform following steps to save power during Sleep mode
OPTION_REG.7 = 1 ' Disable PortA/PortB pull-ups
OSCCON = %0100011 ' Switch to 1 MHz internal oscillator
VRCON = %00100000 ' Set Voltage Reference for minimum power consumption
' Disable CVref
ANSEL= %11110011 ' Set PortA to Analog I/O to save power during Sleep but
' leave Bits 2 & 3 as digital for RA2 pulse count
' TMR0 overflow interrupt & RA3 On-Change intterupt.
ANSELH= %11111111 ' Analog module enabled to save power during Sleep
CM1CON0.7 = 0 ' Turn off comparators during Sleep
CM2CON0.7 = 0
PCON.4 = 0 ' Turn off BOR during Sleep
WDTCON = %00010110 ' Turn WDT off to SLEEP indefinitely
TRISA = %00001101 ' Set RA0, RA2 & RA3 as inputs
TRISB = %11111111 ' Set all PORTB pins to inputs during Sleep
TRISC = %11111111 ' Set all PORTC pins to input during Sleep
PortA = %11111111 ' Write Port A all High to clear mismatch and save
' power during SLEEP
PortB = %11111111 ' Set all Port B and C pins High to save power
PortC = %11111111 ' in Sleep mode
@ sleep
seen any ADC power down in those lines ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks