This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About serial interrupt and routine for serial transmission

i am using a routine for transmmiting some data serially,it works properly,now i have to use serial interrupt for receving some other data. i must have to use interrupt for the reception of data as it can randomly occurs.i have written the c programe for the same but it not only receving any data but also not transmmiting any data which it transmit previously,

what is the reasion.

Parents
  • Why can I not have polled transmit and interrupt based receive for the UART?
    if this is what you mean, then
    1) Polled anything should be avoided if possible
    2) what is the problem transmitting in the ISR?
    3) you need to reset TI in the ISR or the ISR will reenter constantly, thus TI can not be processed in the main if there is an UART ISR
    4) if you absolutely have to do transmit outside the ISR I recommend against it, then change TI in your code to TI_mirror and in the ISR insert
    if (TI)
    TI-mirror =1
    TI = 0

    Erik

Reply
  • Why can I not have polled transmit and interrupt based receive for the UART?
    if this is what you mean, then
    1) Polled anything should be avoided if possible
    2) what is the problem transmitting in the ISR?
    3) you need to reset TI in the ISR or the ISR will reenter constantly, thus TI can not be processed in the main if there is an UART ISR
    4) if you absolutely have to do transmit outside the ISR I recommend against it, then change TI in your code to TI_mirror and in the ISR insert
    if (TI)
    TI-mirror =1
    TI = 0

    Erik

Children
No data