Stop the pic working


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    8

    Default Stop the pic working

    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...

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


    Did you find this post helpful? Yes | No

    Post Stop and Go....

    Hi sgufa,
    Quote Originally Posted by sgufa View Post
    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...
    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 !

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    Jul 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    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

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    @ 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.

  6. #6
    Join Date
    Jul 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    i'm using 16f628a

    can you make me an example for the sleep?

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