
Originally Posted by
nlirette
what i would like to do is put the PIC to sleep in
the for next area of the program
when i replace the "pause 2000" to "sleep 10" it does not work
i want to save battery drain using the low power feature (sleep) of the chip
any reason why the sleep doesn't work?
Norman
Hi Norman,
Welcome to this forum !
Does the circuit work using the For next loop ? What happens when you tell it to sleep ? Does it sleep and fail to awaken, or just never sleeps?
Code:
define osc 20 ' makes the internal oscillator 2 MHZ ( default 4 MGH )
20 ? for 2 ? Also You should get the habit of using all UPPERCASE for defines, a requirement for MPASM.
I am not a SLEEP expert, I have seen it done this way:
and it worked, and would not without the " @ " perhaps someone else can explain to us both as to why.
Edit
Code:
PORTB.0 = 1 ' pin 7
PORTB.1 = 1 ' pin 6
PORTB.5 = 1 ' pin 2
PORTB.4 = 1 ' pin 3
12F683 does not have a PortB it uses GPIO . Are you doing this in a simulator?
Last edited by Archangel; - 26th July 2009 at 07:34.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks