How to force a 16F628A to reset using PBP statement.


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You could use the WDT, but then you would need to insert an assembler routine that looped
    until the WDT reset the PIC. Otherwise PBP will automatically clear the WDT.

    You have the option of telling PBP not to clear WDT, but then it's up to you to manage it,
    and that can really be a pain.

    Another option is to just jump to location 0. PCLATH=0 followed by @ GOTO 0 works if you
    just want to start over from 0.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    ....

    Another option is to just jump to location 0. PCLATH=0 followed by @ GOTO 0 works if you
    just want to start over from 0.
    Bruce,

    Could you be a little more specific with your example please?

    Thanks,
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Sure. If you want to re-start from location 0, then;

    Code:
    X VAR BYTE
    
    TOGGLE 0
    
    Main:
        FOR X = 0 TO 50
         IF X = 20 THEN
          PCLATH = 0
          @ GOTO 0 ' start over from 0 if X = 20
         ENDIF
        NEXT X
        GOTO Main
        
        END
    This isn't exactly the same as a hardware reset, but it's close.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce.

    Since you say that it is not a hard reset but close, will this clear any return addresses in the stack if there is any?


    Thanks.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    No it does not clear the stack.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. Indexer not indexing...a basic PBP problem??
    By jellis00 in forum General
    Replies: 8
    Last Post: - 24th March 2009, 16:53
  3. Help Pbasic to PBP
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd March 2009, 18:35
  4. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  5. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01

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