Can I mix Tx in "main" and Rx in interrupt?
Submitted By: Jan Waclawek FAQ Last Modified: 04/27/07
- No.
Reasoning: If you set TI (directly or indirectly, e.g. by setting SCON = 0x52 in the initialisation section, or calling the usual form of putchar/printf in C), and enable serial interrupt which handles RI only, this interrupt gets executed infinitely, slowing down significantly execution of "main" and disabling interrupts with lower priority (higher ISR address) altogether.
Once the serial interrupt is enabled, both RI and TI should be checked and cleared in it (note that this effectively prevents using standard putchar/printf in C).
(This FAQ was created as a result from this discussion).
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.