Stop the pic working


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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

  2. #2
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Default searching for sleep

    Hi sgufa,

    to search the PICBASIC forum, try pasting this whole line into Google:
    Code:
    nap OR sleep 16f628a OR PIC16f628a site:http://www.picbasic.co.uk/forum/
    or
    to search the Proton forum, try pasting this whole line into Google:
    Code:
    low power 16f628a OR PIC16f628a site:http://www.picbasic.org/forum/
    see also
    Darrel Taylor’s great post:
    A better Search tool for the Forum
    http://www.picbasic.co.uk/forum/show...11&postcount=1

    -Adam-

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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.
    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
    HTH,
    DT

  4. #4
    Join Date
    Jul 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Smile

    many thanks for the suggestions. I'll give it a try...

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. PIC powered by capacitor for 0,5 second
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 25th August 2007, 09:23
  3. VB sending serial data to PIC
    By Tissy in forum Serial
    Replies: 7
    Last Post: - 8th March 2006, 18:31
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. 256 Pics Communicate to 1 Master Pic
    By mazlan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th July 2004, 13:11

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts