2010-08-31 04:40 AM
USART delay?
2011-05-17 05:04 AM
That will obviously depend upon the Baud Rate!
2011-05-17 05:04 AM
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.
2011-05-17 05:04 AM
Sorry I wrote the wrong word. I meant the start bit. :)
2011-05-17 05:04 AM
>>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.