??? 01/15/09 13:50 Modified: 01/15/09 13:51 Read: times |
#161529 - response to Jan Waclawek Responding to: ???'s previous message |
Jan Waclawek said:
If TI is set, the serial ISR is entered. If you don't clear it, the ISR is re-entered again and again, until "main" clears TI. There is always exactly one instruction executed of "main" between consecutive interrupts. Ergo, your "main" will run incredibly slow.
http://www.8052.com/faqs/138108 Yes I read that tutorial however, the program does not work if TI is cleared in the ISR. When the OutChar routine is called and a byte is placed in SBUF, the TI bit is set which causes an interrupt to happen (correct?) The interrupt happens and TI is ignored(or the program would not work in my case). Immediately (the first instruction) upon exiting the ISR, the TI bit is cleared in the OutChar routine. My Question: You mean to say that if TI bit is ignored in the ISR routine that the interrupt would happen continuously, forever? IF that were the case, the program would not work as it does. Jan Waclawek said:
PS. You have read Jon Ledbetter's serial pdf, havent' you? It is pointed to from http://www.8052.com/faqs/120308 . FAQs are your friends... ;-) The interrupt driven example given there is flawed (and Jon did not have time since then to correct it), but otherwise it contains quite a bit of useful information. Yes I read that pdf a long time ago, and read it again now that you mentioned it. The interrupt example uses a delay which is what I discussed in previous threads. I know you say it is flawed, but it also does work. (maybe not as efficiently as some would like) |
Topic | Author | Date |
serial interrupt? | 01/01/70 00:00 | |
Your Problem | 01/01/70 00:00 | |
still not working | 01/01/70 00:00 | |
you need to flag somehow the end of transmission | 01/01/70 00:00 | |
reply to Jan | 01/01/70 00:00 | |
Several | 01/01/70 00:00 | |
To Hans | 01/01/70 00:00 | |
And my reply to Charles | 01/01/70 00:00 | |
no interrupts works | 01/01/70 00:00 | |
the solution | 01/01/70 00:00 | |
Isn't that what Hans said? | 01/01/70 00:00 | |
Perfectly????? Prolly should look again. | 01/01/70 00:00 | |
Got to look ahead... | 01/01/70 00:00 | |
Another thing to consider | 01/01/70 00:00 | |
reply to Andy Neil | 01/01/70 00:00 | |
reply to Michael Karas | 01/01/70 00:00 | |
why is this a bad idea | 01/01/70 00:00 | |
Exactly why not perfect !!! | 01/01/70 00:00 | |
response to Jan Waclawek | 01/01/70 00:00 | |
interrupts forever | 01/01/70 00:00 | |
nope | 01/01/70 00:00 | |
Re: Erik![]() | 01/01/70 00:00 | |
if you HAVE to mix ... | 01/01/70 00:00 |