Software reset


Closed Thread
Results 1 to 17 of 17

Thread: Software reset

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    not sure of it... humm... what is the purpose of this software reset?

    What do you expect?

    Do you set all your registers at the begining?

    Sure you can set all register to the default POR before the goto reset vector ... but those registers are not all to zero... see datasheet for POR setting of each registers.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79


    Did you find this post helpful? Yes | No

    Default

    The ideia in doing the software reset it´s that:
    I have a "security command" and when this contact is closed the circuit work´s normally, but when the contact opens I don´t want that the circuit work´s, but when the contact closes again all my registers goes like it seems we remove the power, like it was the first time we were running the program...

    What I´m thinking to do is modify the value on the registers that I've modified and put them at zero or to the value that had at the beginning!

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


    Did you find this post helpful? Yes | No

    Default

    If you just need to clear all RAM (variables) then use the CLEAR command.

    If you want to start over from location 0 simulating a power-up condition, and clear RAM without a hardware reset, then use;

    @ clrf PCLATH
    @ goto 0

    And place CLEAR as the first BASIC instruction.

    If you have a security check routine that needs to clear RAM when a switch changes state, use the CLEAR command on entry to the routine.

    Lots of options.
    Regards,

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

  4. #4
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79


    Did you find this post helpful? Yes | No

    Thumbs up It works...

    Thank´s, your solution works.
    I was forgetting the clear command...
    The code to do a software reset is:
    clear
    @ clrf PCLATH
    @ goto 0

    Best regards
    Leonel

  5. #5
    Worayoot's Avatar
    Worayoot Guest


    Did you find this post helpful? Yes | No

    Default

    Thank you

    @ clrf PCLATH
    @ goto 0

    I use with 12F work very well

Similar Threads

  1. IC12F508 with Internal Oscillator and Software Reset
    By karan123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd October 2009, 17:13
  2. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 11:04
  3. Replies: 3
    Last Post: - 26th November 2006, 22:47
  4. How to reset the pic by software ?
    By Shamir in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th October 2006, 17:43
  5. Software Driven Reset Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2005, 01:53

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