09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

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.

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

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

Idle or preceding<br />

transmission<br />

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

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

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

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

Data on TX<br />

(from master)<br />

Start<br />

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

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

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

for more details.<br />

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

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

Start LSB MSB Stop<br />

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

(from slave)<br />

LSB<br />

Capture Strobe<br />

SCLK (capture strobe on SCLK<br />

rising edge in this example)<br />

Data on RX<br />

(from slave)<br />

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

Idle or next<br />

transmission<br />

* LBCL bit controls last data clock pulse<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 and CLKEN bits in the USART_CR2 register,<br />

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

The USART can be configured to follow a single-wire half-duplex protocol where the TX and<br />

RX lines are internally connected. The selection between half- and full-duplex<br />

communication is made with a control bit ‘HALF DUPLEX SEL’ (HDSEL in USART_CR3).<br />

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

● the TX and RX lines are internally connected<br />

● the RX pin is no longer used<br />

● the TX pin is always released when no data is transmitted. Thus, it acts as a standard<br />

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

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

t SETUP<br />

valid DATA bit<br />

t HOLD<br />

Stop<br />

Doc ID 018909 Rev 3 768/1416<br />

*<br />

*<br />

8<br />

8<br />

*<br />

*<br />

MSB<br />

*

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

Saved successfully!

Ooh no, something went wrong!