I think Melanie's example in post #3 should do the trick.
Is there something different that you need?
Added: Oops, looking for low power mode. Re-thinking.
<br>
I think Melanie's example in post #3 should do the trick.
Is there something different that you need?
Added: Oops, looking for low power mode. Re-thinking.
<br>
Last edited by Darrel Taylor; - 8th July 2007 at 02:39. Reason: Oops.
DT
Hi sgufa,
to search the PICBASIC forum, try pasting this whole line into Google:
orCode:nap OR sleep 16f628a OR PIC16f628a site:http://www.picbasic.co.uk/forum/
to search the Proton forum, try pasting this whole line into Google:
see alsoCode:low power 16f628a OR PIC16f628a site:http://www.picbasic.org/forum/
Darrel Taylor’s great post:
A better Search tool for the Forum
http://www.picbasic.co.uk/forum/show...11&postcount=1
-Adam-
Ok, this would be for PicBasic Pro. Tested on an 877, but it should still work with a 628.
How you do it in Proton, I haven't got a clue.
HTH,Code:@ DEVICE WDT_OFF ; Disable Watch-Dog timer DEFINE OSC 4 LED VAR PORTB.1 StopPin VAR PORTB.0 INTEDG VAR OPTION_REG.6 ; 0 = falling edge, 1 = rising INTE VAR INTCON.4 ; External interrupt Enable bit INTF VAR INTCON.1 ; External interrupt Flag Delay VAR WORD INPUT StopPin ; Is already default, but just to make sure INTEDG = 0 ; Interrupt on falling edge INTE = 1 ; Enable External Interrupts Main: Toggle LED For Delay = 1 to 500 PAUSE 1 IF StopPin = 1 THEN LOW LED ; Turn OFF anything that will draw current INTF = 0 ; Clear the Interrupt Flag @ SLEEP ; enter Low Power mode GOTO MAIN endif NEXT Delay Goto Main
DT
Bookmarks