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 Reply Children