Theoretically, the bandwidth of the RS485 bus is calculated based on the serial port rate, but in practice, there is a 20ms error.Theoretically:At 9600bps, transmitting 1 byte requires sending 10 bits (1 start bit, 8 data bits, 1 stop bit), so the time required to transmit 1 byte = 1 / 9600bps * 10bit = 1.041ms.In practice:1. The time from RS485 starting to control the bus to actually receiving data is approximately 7.16ms.2. At a baud rate of 9600, transmitting 1 byte takes about 1146us, which is not far from the theoretical value.
- The interval between each byte is about 150us.
- The time for the start bit is about 100us.
- The time for the stop bit is about 60us.
3. After RS485 finishes transmitting data, it takes about 2ms to release the bus.The total time for 43 bytes = 1.146ms * 43 bytes + 9.16ms = approximately 58.483ms.
If using DMA + serial port idle interrupt + timer to handle, it is best to reserve about 10ms more time.