Skip to main content
dkim.3
Associate II
March 20, 2023
Question

Wordlength setting when using Modbus RTU as UART

  • March 20, 2023
  • 2 replies
  • 1420 views

Hello, Now I'm using Modbus RTU and UART. Modbus RTU communication is being performed through UART. Modbus RTU setting is data 8 bytes, but communication is possible only when uart wordlength is set to 9 in STMcubeIDE. Why is wordlength 9 when data is 8?

This topic has been closed for replies.

2 replies

Pavel A.
Super User
March 20, 2023

Parity bit.

According to the Modbus RTU spec, 2.5.1, support for even parity is required. Other modes (no parity, odd parity) are optional.

waclawek.jan
Super User
March 20, 2023

... and in the STM32 UART, confusingly different from other manufacturers' UARTS, the parity bit is counted up to the total word length.

JW