??? 03/07/04 13:10 Read: times |
#66175 - The problem continues Responding to: ???'s previous message |
To Patrick and all guys who are trying to help me I thank you
But the problem is despite lot of reading not only from this site but books like mazidi and ayala , I am still not getting things right,I don't understand why there is a need to wait when I am not using polling but interrupt driven serial comm MOV SBUF,#'R' MOV SBUF,#0DH MOV SBUF,#0AH 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. Does that means after I send R to buffer it will transmit , after the completion of transmission TI is set and an interrupt occurs , the ISR then clear the TI flag and the transmits MOV SBUF,#0DH ; Carriage return then again the cycle continues According to what you are all saying is I wait before transmission of second letter. MOV SBUF,#'R' wait1:jnb ti,wait1 clr ti MOV SBUF,#0DH wait1:jnb ti,wait1 clr ti MOV SBUF,#0AH wouldn't waiting be like polling the ti reg..? I am finding there will be no difference between polling and interrupt driven then .. I would request all of you to bear with me and help me by atleast making sending me a small program that will transmit two charachters using interrupts. Thank you very much Deepak |