Figure 315. Mute Mode Using Address Mark Detection - STMicroelectronics STM32WL5 Series Reference Manual

Advanced arm-based 32-bit mcus with sub-ghz radio solution
Table of Contents

Advertisement

RM0453
In this example, the current address of the receiver is 1
(programmed in the USART_CR2 register)
RX
RWU
35.5.11
USART Modbus communication
The USART offers basic support for the implementation of Modbus/RTU and Modbus/ASCII
protocols. Modbus/RTU is a Half-duplex, block-transfer protocol. The control part of the
protocol (address recognition, block integrity control and command interpretation) must be
implemented in software.
The USART offers basic support for the end of the block detection, without software
overhead or other resources.
Modbus/RTU
In this mode, the end of one block is recognized by a "silence" (idle line) for more than 2
character times. This function is implemented through the programmable timeout function.
The timeout function and interrupt must be activated, through the RTOEN bit in the
USART_CR2 register and the RTOIE in the USART_CR1 register. The value corresponding
to a timeout of 2 character times (for example 22 x bit time) must be programmed in the
RTO register. When the receive line is idle for this duration, after the last stop bit is received,
an interrupt is generated, informing the software that the current block reception is
completed.
Modbus/ASCII
In this mode, the end of a block is recognized by a specific (CR/LF) character sequence.
The USART manages this mechanism using the character match function.
By programming the LF ASCII code in the ADD[7:0] field and by activating the character
match interrupt (CMIE = 1), the software is informed when a LF has been received and can
check the CR/LF in the DMA buffer.
Universal synchronous/asynchronous receiver transmitter (USART/UART)

Figure 315. Mute mode using address mark detection

IDLE
Addr=0 Data 1 Data 2
MMRQ written to 1
(RXNE was cleared)
Non-matching address
IDLE
Addr=1 Data 3 Data 4 Addr=2 Data 5
Mute mode
Matching address
RM0453 Rev 5
RXNE
RXNE
RXNE
Normal mode
Non-matching address
Mute mode
MSv31155V1
1139/1450
1253

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32WL5 Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32wl55 seriesStm32wl54 series

Table of Contents