RE: How to obtain and save the return address inside an interrupt?

"Mauro Zanin [email protected] [msp430]" <[email protected]> Mon, 19 Jan 2015 11:00:55 +0100
Newsgroups gmane.comp.hardware.texas-instruments.msp430.discuss
Message-ID <[email protected]>
Hi 
as far as I know the return address is pushed into stack. So if you pop it and save in a register or memory you have done ! Don't forget to push it again!!!!.


Ciao
Mauro


To: [email protected]
From: [email protected]
Date: Sun, 18 Jan 2015 04:12:19 -0800
Subject: [msp430] How to obtain and save the return address inside an interrupt?




























 


 






  





    
      
      
      
I am using MSP430F2618 and the IAR Workbench (version 6.20).




From time to time I get a watchdog reset. I think I can use the watchdog as a timer, then have an interrupt when it times out. Inside the interrupt I would like to find the return address and maybe even save it in flash. If I could do this, I could find out where the problem is.




Would you have suggestions as to how to find out the return address? I know I have to look at the Stack Pointer and may be at some registers to have the full 20 bit return address. But I do not know what exactly I need to look for. ( Unfortunately, I do not know how to program in assembly.)




Thank you for your suggestions.