Searching \ for 'saving/restoring state information' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=savingrestoring
Search entire site for: 'saving/restoring state information'.

Truncated match.
PICList Thread
'saving/restoring state information'
2000\02\02@211729 by JB

flavicon
face
(Please excuse if this is in a FAQ somewhere, but I have yet to see it
anywhere.)

Is there a commonly accepted method of saving and restoring the state of
the processor during interrupt routines? In particular, I'm interested in
16F8xx parts. Obviously I must save registers that I use, but saving and
restoring the STATUS, etc. registers seems a little tricky. I've see
numerous different implementations which *appear* to work, but I can't be
certain for all possible states.

Pointers anyone?

Thanks.

2000\02\02@213016 by Tony Nixon

flavicon
picon face
JB wrote:
>
> (Please excuse if this is in a FAQ somewhere, but I have yet to see it
> anywhere.)
>
> Is there a commonly accepted method of saving and restoring the state of
> the processor during interrupt routines? In particular, I'm interested in
> 16F8xx parts. Obviously I must save registers that I use, but saving and
> restoring the STATUS, etc. registers seems a little tricky. I've see
> numerous different implementations which *appear* to work, but I can't be
> certain for all possible states.
>
> Pointers anyone?
>
> Thanks.

movwf w_temp
swapf status,w
clrf status
movwf status_temp
movf pclath,w
movwf pclath_temp
clrf pclath
bcf status,irp
movf fsr,w
movwf fsr_temp

; ISR

movf pclath_temp,w
movwf pclath
swapf status_temp,w
movwf status
swapf w_temp
swapf w_temp,w


Reference 16F8XX data sheet pg 145

Funny how they forgot to restore the fsr register, and clearing
status,irp twice.

--
Best regards

Tony

http://www.picnpoke.com
spam_OUTsalesTakeThisOuTspampicnpoke.com

2000\02\03@020046 by Dennis Gearon

flavicon
face
I feel like a religious person................read the book(s) (or web
pages).

--
-----------------------------------------------------------------
Time Spent With Your Dog(Kid) is Time Well Spent
-----------------------------------------------------------------
   Sincerely, Dennis Gearon

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...