STATUS re-curtain W


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Mar 2004
    Location
    San Antonio, Texas
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    I'm not sure what you are trying to do. If you are trying save the registers in your interrupt routine then here is how I do it.


    movwf _w_save ; Save W register
    swapf STATUS,W ; Swap status to be saved into W
    movwf _s_save ; Save STATUS register
    movfw PCLATH
    movwf _p_save ; Save PCLATH


    place your clr interrupt flag and other code here

    Then restore registers before returning from interrupt

    movfw _p_save
    movwf PCLATH ; Restore PCLATH
    swapf _s_save,W
    movwf STATUS ; Restore STATUS register - restores bank
    swapf _w_save,F
    swapf _w_save,W ; Restore W register
    Last edited by Dick M; - 12th February 2005 at 20:11.

Similar Threads

  1. Does I2CREAD/I2CWRITE check for bus status?
    By EToscano in forum Serial
    Replies: 4
    Last Post: - 16th October 2009, 16:43
  2. Problem with 16f88 steep motor control
    By ken_23 in forum Off Topic
    Replies: 0
    Last Post: - 4th July 2008, 12:25
  3. rfPIC Serin problem
    By gavo in forum mel PIC BASIC Pro
    Replies: 52
    Last Post: - 11th March 2008, 17:52
  4. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  5. Xin/Xout Status Request
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd March 2007, 00:09

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