SCI TEI interrupt

I've written my software to follow the sequence in the RA4M1 manual, figure 28.10, and I want to use the TEI interrupt to switch off the RS485 line driver when the data has been sent.

I negate TXI and enable TEI immediately after sending the last byte to TDR.

It works perfectly, apart from one thing - it generates the TEI interrupt twice, even though I negate TEIE in the interrupt service routine.

(Running the ISR twice doesn't affect the operation of the program, but wouldn't it be tidier if if didn't?)

Parents
  • Hello Ian,

    From your comments, I can understand that you don't use any FSP driver to configure the SCI channel, but you have created your own software.

    I am asking it, because some FSP ISR have already been configured to implement the flowchart below:

    Let's suppose that you have created your own code. Do you set the TIE to 0 and TEIE bit to 1 when the TEI interrupt is in use after the last data transmission?

    Regards,

    AL_Renesas

Reply
  • Hello Ian,

    From your comments, I can understand that you don't use any FSP driver to configure the SCI channel, but you have created your own software.

    I am asking it, because some FSP ISR have already been configured to implement the flowchart below:

    Let's suppose that you have created your own code. Do you set the TIE to 0 and TEIE bit to 1 when the TEI interrupt is in use after the last data transmission?

    Regards,

    AL_Renesas

Children