Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/22/03 05:37
Read: times


 
#53073 - RE: wrong code in interrupt routine
Responding to: ???'s previous message
jin li,

You may find it interesting to read the thread at this link.....

http://www.8052.com/forum/read.phtml?id=50530

Here I talked about the same issue. You as the programmer do not get to use the F0 flag I guess. In my case it was a problem of using F0 (PSW.5) in my program only to find that certain library functions use this flag. I noticed it in sprintf() which seems to use it for a temporary storage flag.

You should also be aware that trying to use F0 flag inside an ISR such as you show, if for the moment you ignore the sprintf usage, the setting you so carefully set to 0 or 1 will not make it back to your mainline program. The reason for this is that any interrupt routine that does much of anything at all, and particularly one written in C, will do a PUSH PSW at the beginning and a POP PSW just before the RETI instruction.

MICHAEL KARAS


List of 5 messages in thread
TopicAuthorDate
wrong code in interrupt routine            01/01/70 00:00      
   RE: wrong code in interrupt routine            01/01/70 00:00      
      RE: wrong code in interrupt routine            01/01/70 00:00      
      RE: Keil use of F0, F1 - Michael            01/01/70 00:00      
         RE: Keil use of F0, F1 - Michael            01/01/70 00:00      

Back to Subject List