??? 03/01/04 21:18 Read: times |
#65778 - RE: What is wrong in my serial comm prog Responding to: ???'s previous message |
Deepak Kash wrote:
------------------------------- when I am using interrupt driven comm,once I send a char to sbuf,wouldn't be a interupt triggered ? from the tutorial on this site: Upon execution of the above instruction the 8051 will begin transmitting the character via the serial port. Obviously transmission is not instantaneous--it takes a measureable amount of time to transmit. And since the 8051 does not have a serial output buffer we need to be sure that a character is completely transmitted before we try to transmit the next character. The 8051 lets us know when it is done transmitting a character by setting the TI bit in SCON. When this bit is set we know that the last character has been transmitted and that we may send the next character, if any. so in between transmission of different chars, you will have to check the TI bit. Only if it has been set, you may send your next char by loading the vale in sbuf... then that interrupt should check for TI and clear it and then transmit the next char ? Not sure I understand what you mean... an interrupt cannot check for a flag being set or reset... Make sure you explanation of you problem is clear. regards Patrick |