[En-Nut-Discussion] Bug in half duplex mode

Andrej Taran fant at vinnitsa.com
Mon Aug 28 13:15:16 CEST 2006


Hi  Henrik,



Henrik Maier wrote:

> I would expect this could stay as it is. Can't see anything wrong with 
> this. If there is a reason to move the half-duplex control to 
> AvrUsartTxEmpty, can you please explain?
> In  normal situations TXC is cleared by it's interrupt handler. Why do 
> does it need to be cleared here as well?


Packet transmit is all right. But single byte transmit not correct.
When single byte is sent asynchronous several times, every time executed 
AvrUsartTxStart, enable transmit interrupts and executed AvrUsartTxEmpty.
But last byte can be transmitting,  when AvrUsartTxEmpty is executed for 
current byte. AvrUsartTxComplete execute for last byte, after 
AvrUsartTxEmpty is executed for current byte and clear UART_HDX_BIT. And 
current byte  will be spoilt.
Clear TXC and half-duplex control in AvrUsartTxEmpty solves problem.

Regards,
Andrej Taran




More information about the En-Nut-Discussion mailing list