NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
357
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
6.13.5.9 RS-485 Function Mode
Another alternate function of UART Controller is RS-485 function (user must set UA_FUN_SEL
[1:0] to
“11” to enable RS-485 function), and direction control provided by RTS pin from an
asynchronous serial port. The RS-485 transceiver control is implemented by using the RTS
control signal to enable the RS-485 driver. Many characteristics of the RX and TX are same as
UART in RS-485 mode.
The UART controller can be configured as an RS-485 addressable slave and the RS-485 master
transmitter will identify an address character by setting the parity (9-th bit) to 1. For data
characters, the parity is set to 0. Software can use UA_LCR register to control the 9-th bit (When
the PBE(UA_LCR[3]), EPE(UA_LCR[4]) and SPE(UA_LCR[5]) are set, the 9-th bit is transmitted 0
and when PBE and SPE are set and EPE is cleared, the 9-th bit is transmitted 1).
The controller supports three operation modes: RS-485 Normal Multidrop Operation Mode
(NMM), RS-485 Auto Address Detection Operation Mode (AAD) and RS-485 Auto Direction
Control Operation Mode (AUD). Software can choose any operation mode by programming the
UA_ALT_CSR register, and drive the transfer delay time between the last stop bit leaving the TX
FIFO and the de-assertion of by setting DLY (UA_TOR [15:8]) register.
6.13.5.9.1
RS-485 Normal Multidrop Operation Mode (NMM)
In RS-485 Normal Multidrop Operation Mode (RS485_NMM(UA_ALT_CSR[8]) = 1), in first,
software must decide the data which before the address byte be detected will be stored in RX
FIFO or not. If software wants to ignore any data before address byte detected, the flow is set
RX_DIS (UA_FCR [8]) then enable RS485_NMM (UA_ALT_CSR [8]) and the receiver will ignore
any data until an address byte is detected (bit 9 = 1) and the address byte data will be stored in
the RX FIFO. If software wants to receive any data before address byte detected, the flow is
disables RX_DIS (UA_FCR [8]) then enable RS485_NMM (UA_ALT_CSR [8]) and the receiver
will received any data.
If an address byte is detected (bit 9 = 1), it will generate an interrupt to CPU and RX_DIS
(UA_FCR [8]) can decide whether accepting the following data bytes are stored in the RX FIFO. If
software disables receiver by setting RX_DIS (UA_FCR [8]) register, when a next address byte is
detected, the controller will clear the RX_DIS (UA_FCR [8]) bit and the address byte data will be
stored in the RX FIFO.
6.13.5.9.2
RS-485 Auto Address Detection Operation Mode (AAD)
In RS-485 Auto Address Detection Operation Mode (RS485_AAD(UA_ALT_CSR[9]) = 1), the
receiver will ignore any data until an address byte is detected (bit 9 = 1) and the address byte
data matches the ADDR_MATCH (UA_ALT_CSR[31:24]) value. The address byte data will be
stored in the RX FIFO. The all received byte data will be accepted and stored in the RX FIFO until
an address byte data not match the ADDR_MATCH (UA_ALT_CSR[31:24]) value.
6.13.5.9.3
RS-485 Auto Direction Mode (AUD)
Another option function of RS-485 controllers is RS-485 auto direction control function
(RS485_AUD(UA_ALT_CSR[10) = 1). The RS-485 transceiver control is implemented by using
the RTS control signal from an asynchronous serial port. The RTS line is connected to the RS-
485 transceiver enable pin such that setting the RTS line to high (logic 1) enables the RS-485
transceiver. Setting the RTS line to low (logic 0) puts the transceiver into the tri-state condition to
disabled. User can set LEV_RTS in UA_MCR register to change the RTS driving level.
The following diagram demonstrates the RS-485 RTS driving level in AUD mode. The RTS pin
will be automatically driven during TX data transmission.