??? 03/07/04 13:46 Read: times |
#66181 - RE: What I have understood till now Responding to: ???'s previous message |
Deepak Kash wrote:
------------------------------- As TI is set it causes an interrupt at 0023h Above is correct The serial ISR clears the TI flag and RETI That is possible, it depends on what YOUR ISR is doing... The PC points to location of next instruction MOV SBUF,#0DH Then again After the last bit is sent ,TI is set As TI is set it causes an interrupt at 0023h WHy would your cpu wait until the SBUF is transmitted? It will immediately fetch the next instruction and continue your program The serial ISR clears the TI flag and RETI The PC points to location of next instruction MOV SBUF,#0AH You seem to have missed the meaning of an ISR... an ISR is NOT meant to just make the CPU wait before running it's next instruction. Your ISR should run each time the TI bit is set, ie each time the char you loaded into SBUF is transmitted. That means that your ISR must 1) clear the TI-bit 2) fetch the next char to be transmitted from a buffer 3) update the buffer pointer 4) move the char to SBUF 5) RETI Look upon your ISR as a program that is executed each time the interrupt is triggered. HTH regards Patrick |