Hi,
New to the forum,
Melanie you may have already rxed a message.
I am trying to save power and 12f675 draws almost nothing when asleep.
Here the program
' GPIO.0 = Led Out
' GPIO.1 =
' GPIO.2 = Trigger In
' GPIO.3 =
' GPIO.4 = Osc
' GPIO.5 = Osc
DEFINE ONINT_USED 1
INTCON.3 = 1 ' Enable the port change interrupt
CMCON = 7 ' Disables Analog Inputs
ANSEL = 0 ' Sets Analog Inputs as Digital I/O
TRISIO = $FF ' All As Inputs
High GPIO.0
Pause 10
Low GPIO.0
On_Test: ' Wait for the interupt on GPIO.2, ie Rear Panel Switch
Pause 1
IF GPIO.2 = 0 Then
GoTo Awake
EndIf
INTCON.0 = 0 ' Clear the RB port change flag bit
Nap 7 ' Go to sleep. When the watchdog is
' disabled, NAP won't wake up until
' an interrupt occurs.
GoTo On_Test ' Do it again upon waking
Awake:
Low GPIO.0
Pause 10
High GPIO.0
Pause 10
GoTo Awake
All the progam does is wakes up, doesn't perform awake, then goes back to sleep. (I monitor the current consuption)
When I program the PIC I leave the watchdog off.
Thanks for any help
Peter
Bookmarks