Universal synchronous asynchronous receiver
transmitter (USART)
23.2.11 Half-duplex mode function
This subsection provides a set of functions allowing to manage the USART Half-duplex
communication.
The USART can be configured to follow a single-wire half-duplex protocol where the TX
and RX lines are internally connected.
USART Half duplex communication is possible through the following procedure:
1. Program the Baud rate, Word length, Stop bits, Parity, Mode transmitter or Mode
receiver and hardware flow control values using the USART_Init() function.
2. Configures the USART address using the USART_SetAddress() function.
3. Enable the half duplex mode using USART_HalfDuplexCmd() function.
4. Enable the USART using the USART_Cmd() function.
The RX pin is no longer used.
In Half-duplex mode the following bits must be kept cleared:
ï‚· LINEN and CLKEN bits in the USART_CR2 register.
ï‚· SCEN and IREN bits in the USART_CR3 register.
ï‚· USART_HalfDuplexCmd()
23.2.12 Smartcard mode functions
This subsection provides a set of functions allowing to manage the USART Smartcard
communication.
The Smartcard interface is designed to support asynchronous protocol Smartcards as
defined in the ISO 7816-3 standard. The USART can provide a clock to the smartcard
through the SCLK output. In smartcard mode, SCLK is not associated to the
communication but is simply derived from the internal peripheral input clock through a 5-bit
prescaler.
Smartcard communication is possible through the following procedure:
1. Configures the Smartcard Prsecaler using the USART_SetPrescaler() function.
2. Configures the Smartcard Guard Time using the USART_SetGuardTime() function.
3. Program the USART clock using the USART_ClockInit() function as following:
ï€ USART Clock enabled.
ï€ USART CPOL Low.
ï€ USART CPHA on first edge.
ï€ USART Last Bit Clock Enabled.
4. Program the Smartcard interface using the USART_Init() function as following:
ï€ Word Length = 9 Bits.
ï€ 1.5 Stop Bit.
ï€ Even parity.
ï€ BaudRate = 12096 baud.