Electronic – Why does the delay between bytes increase when I increase UART baud rate

avrmicrocontrolleruart

Something interesting to note, which I am not fully understanding. My UART is initialized with 9600 baud. I've looked at the TX on the line via logic analyzer, and the bytes I send have minimal delay. It is 36µs per byte, which is expected.

Now, if I initialize that UART with a different baud rate, say 115,200, the delay between each byte sent increases significantly. It jumps to 125µs per byte.

This is causing a problem, since I've got to increase my baud rate at some point, but have a time constraint on my response.

Shouldn't the delay decrease between bytes, since it should be sending more bits at the same frequency?

EDIT:

I am using an ATMega2560.

Two timing diagrams are attached below.

~9600 Baud Rate –
Baud9600_1

enter image description here

~115200 Baud Rate –
enter image description here

Best Answer

The higher baudrate makes the UART module transmit faster, so you have more "spacing" between the bytes, but it seems to me that the rate at which you're transmitting the bytes is still the same. Your timing diagrams are missing total time so its hard to see if this is the case. Don't compare last edge to first edge. Compare the first edges of the the two bytes. Are these still the same?