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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/08/02 21:28
Read: times


 
#19574 - RE: In summary
Marco, the original code you posted is indeed missing a CLR TI instruction in the line after the INC A instruction and in the line before the RETI instruction. That's the only difference I see between the code you posted and the code you mention in MacKenzie's book--other than the missing SJMP..

That being said, this program is useful for understanding interrupt-driven serial communication. But be sure to refer to my previous message regarding the CJNE instruction and protecting the PSW/Accumulator/other registers within an interrupt routine.

In reviewing MacKenzie's chapter on Interrupts I'm surprised to see he doesn't touch on this--at least I don't see him mentioning it. He says "Some of the most difficult bugs in system design often involved interrupts" but doesn't go on to explain why that is... It's often because registers aren't properly protected and restored.

In this serial ISR example he is actually counting on the accumulator not being restored. Since the program doesn't do anything else that's ok. But if, instead of executing SJMP $, your main loop was doing anything else you'd almost certainly provoke weird stuff by modifying the accumulator and PSW without restoring them when you exit the subroutine.

Craig Steiner


List of 68 messages in thread
TopicAuthorDate
HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: In summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: MSN / ICQ            01/01/70 00:00      
RE: MSN / ICQ            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
the problem is same            01/01/70 00:00      
more            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: the problem is same            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: I summary            01/01/70 00:00      
What happened with......            01/01/70 00:00      
RE: this is no 50 !            01/01/70 00:00      
RE: this is no 50 !            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: What happened with......            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
We are keeping going.....            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
need help programming uart and adc in c            01/01/70 00:00      
Hi guys I here again            01/01/70 00:00      
RE: Hi guys I here again            01/01/70 00:00      
RE: HELP ME........            01/01/70 00:00      
It's working guys.........            01/01/70 00:00      

Back to Subject List