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 18:06
Read: times


 
#19563 - RE: I summary
I agree with everything that's been recommended. In summary:

1. You don't have a "main" loop that cycles. Executing your program, since it has no main loop, will fall right into the interrupt service routine and execute it. That's bad.

2. Your interrupt service routine doesn't clear RI nor TI. It will execute over and over again until you clear those bits.

In addition:

3. Your ISR is not protecting the PSW register. Your CJNE instruction may end up modifying the value of the carry bit which, in a normal ISR in virtually any program, is a bad thing. You should PUSH PSW onto the stack at the beginning of the ISR and POP PSW at the end.

4. Your ISR is modifying the value of the accumulator. This might be ok just for a test, but an ISR normally should not modify the value of any register without protecting it. Instead of incrementing the accumulator you should be incrementing the value of an Internal RAM address, and writing that value to SBUF. Otherwise, if you using the Accumulator outside of the ISR you are going to get unpreditable results.

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