How to stop the pic working when 1 input goes high? And how to make it resume when the same imput goes low? Please help me...
How to stop the pic working when 1 input goes high? And how to make it resume when the same imput goes low? Please help me...
Hi sgufa,You could try the sleep command. Don’t forget the watchdog timer, make sure it is turned on.
Wake up little PIC!
http://www.picbasic.co.uk/forum/showthread.php?t=6377
Permanent sleep
http://www.picbasic.co.uk/forum/showthread.php?t=3128
Try searching the forum for sleep.
Hope that helps,
-Adam-
Ohm it's not just a good idea... it's the LAW !
You've not specified the reasons why the PIC should be stopped (or indeed your definition of 'Stop', or how quickly it should happen, or the state of the PIC when it is stopped), so to experiment, why not simply start with...
Code:LED var PortB.1 StopPin var PortB.0 TRISB=%00000001 Loop: Toggle LED Pause 500 While StopPin=1:Wend Goto Loop
many thanks melanie but i've just did the same. In that way the pic is always ON. I'd want to put the pic in low power mode when the input goes high and then, when the input returns low, wake up the pic in order to resume his work
@ SLEEP
will do the job.
Now depending the PIC you're using, you need to be check which i/o can wake the PIC.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks