GD32VF103 User Manual
337
big burden for a device to monitor all of the messages on the RX pin. To reduce the burden
of a device, software can put an USART module into a mute mode by setting the RWU bit in
USART_CTL0 register.
If a USART is in mute mode, all of the receive status bits cannot be set. Software can wake
up the USART by clearing the RWU bit.
The USART can also be woken up by hardware by one of the two methods: idle frame method
and address match method.
The idle frame wake up method is selected by default. When an idle frame is detected on the
RX pin, the hardware clears the RWU bit and exits the mute mode. When it is woken up by
an idle frame, the IDLEF bit in USART_STAT will not be set.
When the WM bit of in USART_CTL0 register is set, the MSB bit of a frame is detected as the
address flag. If the address flag is high, the frame is treated as an address frame. If the
address flag is low, the frame is treated as a data frame. If the LSB 4 bits of an address frame
are the same as the ADDR[3:0] bits in the USART_CTL1 register, the hardware will clear the
RWU bit and exits the mute mode. The RBNE bit will be set when the frame that wakes up
the USART. The status bits are available in the USART_STAT register. If the LSB 4 bits of an
address frame differ from the ADDR[3:0] bits in the USART_CTL1 register, the hardware sets
the RWU bit and enters mute mode automatically. In this situation, the RBNE bit is not set.
If the address match method is selected, the receiver does not check the parity value of an
address frame by default. If the PCEN bit in USART_CTL0 is set, the MSB bit will be checked
as the parity bit, and the bit preceding the MSB bit is detected as the address bit.
16.3.8.
LIN mode
The local interconnection network mode is enabled by setting the LMEN bit in USART_CTL1.
The CKEN, WL, STB[1:0] bits in USART_CTL1 and the SCEN, HDEN, IREN bits in
USART_CTL2 should be cleared in LIN mode.
When transmitting a normal data frame, the transmission procedure is the same as the normal
USART mode. When the SBKCMD bit in USART_CTL0 is set, the USART transmits 13
‘
0
’
bits continuously, followed by 1 stop bit.
The break detection function is totally independent of the normal USART receiver. So a break
frame can be detected during the idle state or during a frame. The expected length of a break
frame can be selected by configuring LBLEN bit in USART_CTL1. When the RX pin is
detected at low state for a time that is equal to or longer than the expected break frame length
(10 bits when LBLEN=0, or 11 bits when LBLEN=1), the LBDF in USART_STAT is set. An
interrupt occurs if the LBDIE bit in USART_CTL1 is set.
Figure 16-9. Break frame occurs during idle state
, if a break frame occurs
during the idle state on the RX pin, the USART receiver will receive an all
‘
0
’
frame, with an
asserted FERR status.