cancel
Showing results for 
Search instead for 
Did you mean: 

USART2 TC interrupt timing

geoff239955_st
Associate II
Posted on July 21, 2014 at 21:47

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-interrupt
3 REPLIES 3
Posted on July 21, 2014 at 21:53

3.5us with respect to what? the trailing edge of the last bit, or the stop bit(s)?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
geoff239955_st
Associate II
Posted on July 21, 2014 at 22:17

The trailing edge of the stop bit.

Posted on July 21, 2014 at 22:29

''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.''
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..