2014-07-21 12:47 PM
I am using the TC (transmission complete) interrupt on USART2 to detect end of transmission of a packet. I have noticed that the interrupt isn't triggered until approximately 3.5us after the last byte is transmitted. The baud rate is set to 115200, so 3.5us is about 40% of a bit time.
Is this the expected behavior? Can the time be adjusted? I would like the TC interrupt to trigger as soon as the last byte is transmitted. #usart-interrupt2014-07-21 12:53 PM
3.5us with respect to what? the trailing edge of the last bit, or the stop bit(s)?
2014-07-21 01:17 PM
The trailing edge of the stop bit.
2014-07-21 01:29 PM
''The assertion of the TC flag can be delayed by programming the Guard Time register.
In normal operation, TC is asserted when the transmit shift register is empty and no
further transmit requests are outstanding. In Smartcard mode an empty transmit shift
register triggers the guard time counter to count up to the programmed value in the
Guard Time register. TC is forced low during this time. When the guard time counter
reaches the programmed value TC is asserted high.''