Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
474
/
631
allows data to be transmitted in one direction at the same time. Communication conflicts are managed by software.
Through the USART_CTRL3.HDMEN bit, you can choose whether to enable half-duplex mode. When using single-
wire half-duplex, USART_CTRL2. CLKEN, USART_CTRL2. LINMEN, USART_CTRL3. SCMEN,
USART_CTRL3. IRDAMEN, these bits should be kept clear.
After the half-duplex mode is turned on, the TX pin and the RX pin are interconnected inside the chip, and the Rx
pin is no longer used. When there is no data to transmit, TX is always released. Therefore, when not driven by the
USART, the TX pin must be configured as a floating input or an open-drain output high.
IrDA SIR ENDEC mode
USART supports the IrDA (Infrared Data Association) SIR ENDEC specification.
Through the USART_CTRL3. IRDAMEN bit, you can choose whether to enable the infrared mode. When using the
infrared
function,
USART_CTRL2.CLKEN,
USART_CTRL2.STPB[1:0],
USART_CTRL2.LINMEN,
USART_CTRL3.HDMEN, USART_CTRL3.SCMEN, these bits should be kept clear.
Through the USART_CTRL3. IRDALP bit, it can be used to select normal mode or low power infrared mode.
IrDA normal mode
When USART_CTRL3.IRDALP=0, select normal infrared mode.
IrDA is a half-duplex communication protocol, so there should be a minimum delay of 10ms between sending and
receiving.that uses a inverted return-to-zero modulation scheme (RZI), which uses an infrared light pulse to represent
a logic '0', and the pulse width is specified as 3/16 of a bit period in normal mode, as shown in the Figure
22-19.USART only supports up to 115200bps for SIR ENDEC.
The USART sends data to the SIR encoder, and the bit stream output by the USART will be modulated. A modulated
stream of pulses is sent from the infrared transmitter and then received by the infrared receiver. The SIR receiver
decoder demodulates it and outputs the data to the USART.
The transmit encoder output has opposite polarity to the decoder input. When idle, SIR transmit is low, while SIR
receive is high. The high pulse sent by SIR is '0' and the low level is '1', while SIR reception is the opposite.
If the USART is sending data to the IrDA transmit encoder, then the IrDA receive decoder will ignore any data on
the IrDA receive line. If the USART is receiving data sent from the SIR receiver decoder, the data sent by the USART
to the IrDA transmitter encoder will not be encoded.
Pulse width is programmable. The IrDA specification requires pulses to be wider than 1.41us. For pulse widths less
than 2 cycles, the receiver will filter them out. PSCV is the prescaler value programmed in the USART_GTP register.
IrDA low power mode
When USART_CTRL3.IRDALP=1, select low power infrared mode.
For the transmitter, when in low power mode, the pulse width is 3 times the low power baud rate, which is a minimum
of 1.42MHz. Typically this value is 1.8432MHz (1.42 MHz < PSC < 2.12 MHz).
For the receiver, the requirement for a valid signal is that the duration of the low level signal must be greater than 2
cycles of the IrDA low power baud rate clock.