English
Language : 

RM0366 Datasheet, PDF (731/868 Pages) STMicroelectronics – This reference manual targets application developers
Universal synchronous asynchronous receiver transmitter (USART)
RM0366
The USART enters mute mode when an address character is received which does not
match its programmed address. In this case, the RWU bit is set by hardware. The RXNE
flag is not set for this address byte and no interrupt or DMA request is issued when the
USART enters mute mode.
The USART also enters mute mode when the MMRQ bit is written to 1. The RWU bit is also
automatically set in this case.
The USART exits from mute mode when an address character is received which matches
the programmed address. Then the RWU bit is cleared and subsequent bytes are received
normally. The RXNE bit is set for the address character since the RWU bit has been
cleared.
An example of mute mode behavior using address mark detection is given in Figure 281.
Figure 281. Mute mode using address mark detection
,QWKLVH[DPSOHWKHFXUUHQWDGGUHVVRIWKHUHFHLYHULV
SURJUDPPHGLQWKH86$57B&5UHJLVWHU
5;1( 5;1( 5;1(
5;
,'/( $GGU  'DWD 'DWD ,'/( $GGU  'DWD 'DWD $GGU  'DWD
26.5.8
5:8
0XWHPRGH
1RUPDOPRGH
0XWHPRGH
0054ZULWWHQWR
5;1(ZDVFOHDUHG
1RQPDWFKLQJDGGUHVV
0DWFKLQJDGGUHVV
1RQPDWFKLQJDGGUHVV
06Y9
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
USARTx_CR2 register and the RTOIE in the USARTx_CR1 register. The value
corresponding to a timeout of 2 character times (for example 22 x bit duration) 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.
731/868
DocID025203 Rev 2