Software reset


Closed Thread
Results 1 to 17 of 17

Thread: Software reset

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default 16f

    I'm using 16F so the @reset itīs not possible.
    I didnīt try the I/O method because my PCB is done...

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


    Did you find this post helpful? Yes | No

    Default

    my assumption is by using this method, it jumps only to the reset vector. So it doesn't produce any effects on the registers... so the i/o style should be considered.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Put all registers to zero

    Yes, I agree with you...
    What do you think the ideia to do software reset putting all my registers to zero. Itīs easier and i havenīt to use the I/O method

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

  5. #5
    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!

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

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

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, 16:13
  2. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 10:04
  3. Replies: 3
    Last Post: - 26th November 2006, 21:47
  4. How to reset the pic by software ?
    By Shamir in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th October 2006, 16:43
  5. Software Driven Reset Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2005, 00:53

Members who have read this thread : 1

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