??? 04/17/08 14:18 Read: times |
#153616 - explanation Responding to: ???'s previous message |
Russ Cooper said:
Jan said:
In this particular case, the mixed method is detrimental if you use the TI flag the other way round, i.e. if you check-and-clear it BEFORE inserting character into SBUF (which is the better way to do things anyway, isn't it). The cautionary note therefore is issued, and if you obey it as you should, you don't run into problems, regardless of what you do with TI. I don't think I understand what you are saying here. If you think it is better to do the check-and-clear before loading SBUF, why do you also say it is "detrimental"? It's not the "check-and-clear-TI before loading SBUF" which is detrimental, but the mixed Tx-in-main-Rx-in-interrupt is. The latter is almost harmful - as expected, and also as your experience shows - if you perform the check-and-clear-TI immediately after loading SBUF. Russ Cooper said:
Also, what is this "cautionary note" you are talking about? "Don't mix Tx in main and Rx in interrupt". Russ Cooper said:
Assuming the hardware is working correctly, and if I guarantee that SBUF is only loaded in the one place, and if I guarantee that TI is not set anywhere in the program, is there any chance that TI can be set except as a result of loading SBUF? IMHO No. JW |
Topic | Author | Date |
Interrupt-driven Rx, polled Tx | 01/01/70 00:00 | |
this is why we have the FAQs... | 01/01/70 00:00 | |
Maybe I'm crazy | 01/01/70 00:00 | |
if you do that | 01/01/70 00:00 | |
Polled transmission | 01/01/70 00:00 | |
Mixing modes on UART | 01/01/70 00:00 | |
Here's why I asked | 01/01/70 00:00 | |
the risks of doing things the "wrong way" | 01/01/70 00:00 | |
the old nugget | 01/01/70 00:00 | |
Cool idea | 01/01/70 00:00 | |
size | 01/01/70 00:00 | |
Is the \"wrong way\" risky, or just stupid? | 01/01/70 00:00 | |
explanation | 01/01/70 00:00 | |
Thanks. I understand now what you are saying | 01/01/70 00:00 |