cancel
Showing results for 
Search instead for 
Did you mean: 

USART delay?

sima2
Associate III
Posted on August 31, 2010 at 13:40

USART delay?

4 REPLIES 4
Posted on May 17, 2011 at 14:04

That will obviously depend upon the Baud Rate!

Posted on May 17, 2011 at 14:04

It depends on the baud rate, and the state of the shift register when the buffer register is loaded. For 8 N 1, with the TXE going high, you are looking at 10 bit times. You should use the TC (transmit complete) flag/interrupt to know when the transmitter has completed.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sima2
Associate III
Posted on May 17, 2011 at 14:04

Sorry I wrote the wrong word. I meant the start bit. :)

Posted on May 17, 2011 at 14:04

>>Sorry I wrote the wrong word. I meant the start bit. :)

It depends on how you want to use the USART. If you need to know the TX time for the start bit you are basically going to have to wait for *both* TXE and TC to be high, *then* load the byte you want to send. The time you load the register should be reasonably close to the time the start bit occurs. The USART is clock by a synchronous clock 16x the baud clock, as well as the APB clock. How accurately do you want to know the time? Do you want to be streaming bytes?

You could get a reasonable estimate of the *last* byte transmit time for the start bit by watching the TXE bit going high indicating the last byte has entered the USART shift register.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..