29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Universal synchronous asynchronous receiver transmitter (USART)<br />

RM0008<br />

Figure 250. USART data clock timing diagram (M=1)<br />

Idle or preceding<br />

transmission<br />

Clock (CPOL=0, CPHA=0)<br />

Start<br />

M=1 (9 data bits)<br />

*<br />

Stop<br />

Idle or next<br />

transmission<br />

Clock (CPOL=0, CPHA=1)<br />

*<br />

Clock (CPOL=1, CPHA=0)<br />

*<br />

Clock (CPOL=1, CPHA=1)<br />

*<br />

Data on TX<br />

(from master)<br />

0 1 2 3 4 5 6 7<br />

Start LSB MSB Stop<br />

8<br />

Data on RX 0 1 2 3 4 5 6 7<br />

(from slave)<br />

LSB<br />

Capture Strobe<br />

8<br />

MSB<br />

*<br />

* LBCL bit controls last data clock pulse<br />

Figure 251. RX data setup/hold time<br />

SCLK (capture strobe on SCLK<br />

rising edge in this example)<br />

Data on RX<br />

(from slave)<br />

valid DATA bit<br />

t SETUP<br />

t HOLD<br />

t SETUP = t HOLD 1/16 bit time<br />

Note:<br />

The function of SCLK is different in Smartcard mode. Refer to the Smartcard mode chapter<br />

for more details.<br />

25.3.10 Single-wire half-duplex communication<br />

The single-wire half-duplex mode is selected by setting the HDSEL bit in the USART_CR3<br />

register. In this mode, the following bits must be kept cleared:<br />

● LINEN <strong>and</strong> CLKEN bits in the USART_CR2 register,<br />

● SCEN <strong>and</strong> IREN bits in the USART_CR3 register.<br />

The USART can be configured to follow a single-wire half-duplex protocol. In single-wire<br />

half-duplex mode, the TX <strong>and</strong> RX pins are connected internally. The selection between half<strong>and</strong><br />

full-duplex communication is made with a control bit ‘HALF DUPLEX SEL’ (HDSEL in<br />

USART_CR3).<br />

As soon as HDSEL is written to 1:<br />

● RX is no longer used,<br />

● TX is always released when no data is transmitted. Thus, it acts as a st<strong>and</strong>ard I/O in<br />

idle or in reception. It means that the I/O must be configured so that TX is configured as<br />

floating input (or output high open-drain) when not driven by the USART.<br />

674/995 Doc ID 13902 Rev 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!