Electronic – Does a baudrate in serial communication (USB or RS232) need to be exact

baudrateclock-speedserial

In serial communication, does the baudrate mean we have to use the exact clock speed or is it a range of speeds that we can use?

and if it's an exact value, how exact should it be ?
for example, can i use 555 as the clock of a serial communication circuit ?

Best Answer

The timings have to be accurate enough that they don't drift apart before the protocol resyncronises.


UART serial resyncronises on each byte and a byte is around 10 bits (8 bits of data plus start and stop). We assume that our UART targets the middle of each bit. If everything is is perfect and only one end is inaccurate that allows for approximately 5% difference between the two ends of the link.

However:

  1. Both ends of the link may be inaccurate relative to nominal. In the worst case one end may be under nominal while the other is over nominal.
  2. There may be systematic inaccuraries. For example most UARTS have a limited range of baud rate generator settings.
  3. Your UART is based on a master clock with a finite speed. Even if the clocking and baud rate generator are perfect this will result in it not hitting the exact middle of each bit.

The bottom line is that 1% error on your clock is almost certainly fine. 5% error is almost certainly a problem. Between those two figures it may or may not be a problem depending on the overall picture.

That is a tall order for a RC oscilator. Lets say your R has a 1% tolerance and your C has a 2% tolerance. That gives about a 3% tolerance for the RC network's time constant and that is before you think about any errors introduced by your driver chip.

So the bottom line is you should be looking at a crystal or ceramic resonator.


As for USB I don't have the experiance to analyse from first principles but https://www.silabs.com/community/interface/knowledge-base.entry.html/2004/03/15/usb_clock_tolerance-gVai says 1.5% for low speed and 0.25% for full speed.

Related Topic