How to set up your UART

Calculations to set up your UART according to your desired sample rate

The maximum sample rate of Gantner modules is directly connected to the available baud rate, the number of modules, and the number of transferred values on the UART.

The Design Rule check calculates these communication times:

  • n: number of modules
  • nO: number of modules with output data bytes
  • Idle Bytes: 3

Inputs

  • 1: First byte gap at the start of each cycle
  • n*1: Sequential byte gap between modules
  • n*1: Address byte per module
  • n*1: Length byte for the data length
  • n*1: Fcs byte

Sum of all Input data bytes of all Modules

This results in:

1+ n*4 + Sum of input bytes

Outputs

  • 1 Idle byte
  • 1 Sync byte
  • 1 Ed byte
  • nO *1 Length byte
  • nO* 1 Address byte
  • nO* 1 Fcs byte

Sum of all Output Data Bytes

This results in:

3+nO*3+ Sum of output bytes

 

The result of these calculations can then be added up to get the bytes per cycle.

Multiplying the bytes per cycle with the desired sample rate in Hz results in the bytes per second.

Multiplying this by 8 results in bits per second or baud. The set baud rate of your UART needs to be higher than this number.

The design rule check calculates with a maximum of 90% bus load and will show a warning above 85% load.

The baud rate can be set in your UART settings and is dependent on the wire length and also quality. Under ideal circumstances and while using Profibus approved cabling the estimated cable lengths are as follows Baudrates up to 12000 kBaud are derived from the Profibus standard 24000 and 48000 are estimates:

Baud rate [kBit/s] Range [m]
187,5 1000
500 400
1500 200
3000; 6000; 12000 100
24000 10
48000 0

 

 

Author: Marc-Oliver Hess