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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/24/03 08:03
Read: times


 
#51294 - RE: Serial interrupt - code snippets
Responding to: ???'s previous message
A couple of comments.

1. Unless you really want to use automatic address recognition, don't set SM2 (SCON.5) I think you want to set it to 0x50 instead.

2. You don't check Ptr_Ser_Rx limit, which would mean that at a certain moment in time you will start overwriting data memory unwillingly.

3. ser_getch() might never get to the return(SBUF) instruction; when an RI occurs, the ISR is called where RI is reset. Upon return, RI will thus be 0 and the while.. will hold again. Much depends upon what the generated asm code looks like, but the chances are there and thus you should handle that differently. I would simply set a flag in the ISR indicating that data is received.

4. The same as above goes for your transmit loop.

Hope this gets you on the right track.

List of 7 messages in thread
TopicAuthorDate
Serial interrupt            01/01/70 00:00      
   RE: Serial interrupt            01/01/70 00:00      
      RE: Serial interrupt - code snippets            01/01/70 00:00      
         RE: Serial interrupt - code snippets            01/01/70 00:00      
   RE: Serial interrupt            01/01/70 00:00      
      RE: Serial interrupt            01/01/70 00:00      
         RE: Serial interrupt            01/01/70 00:00      

Back to Subject List