29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

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

Idle characters<br />

25.3.3 Receiver<br />

Setting the TE bit drives the USART to send an idle frame before the first data frame.<br />

The USART can receive data words of either 8 or 9 bits depending on the M bit in the<br />

USART_CR1 register.<br />

Start bit detection<br />

In the USART, the start bit is detected when a specific sequence of samples is recognized.<br />

This sequence is: 1 1 1 0 X 0 X 0X 0X 0 X 0X 0.<br />

Figure 242. Start bit detection<br />

RX state<br />

Idle<br />

Start bit<br />

RX line<br />

Ideal<br />

sample<br />

clock<br />

Real<br />

sample<br />

clock<br />

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16<br />

sampled values<br />

X X X X X X X X 9 10 11 12 13 14 15 16<br />

6/16<br />

7/16<br />

7/16<br />

Conditions<br />

to validate<br />

the start bit<br />

1<br />

1<br />

Falling edge<br />

detection<br />

1 0 X 0 X 0 X 0 0 0 0 X X X X X X<br />

At least 2 bits<br />

out of 3 at 0<br />

One-bit time<br />

At least 2 bits<br />

out of 3 at 0<br />

ai15471<br />

Note:<br />

If the sequence is not complete, the start bit detection aborts <strong>and</strong> the receiver returns to idle<br />

state (no flag is set) waiting for a falling edge.<br />

If only 2 out of the 3 bits are at 0 (sampling on the 3 rd , 5 th <strong>and</strong> 7 th bits or sampling on the 8 th ,<br />

9 th <strong>and</strong> 10 th bits), the start bit is validated but the NE noise flag bit is set.<br />

The start bit is confirmed if the last 3 samples are at 0 (sampling on the 8 th , 9 th , <strong>and</strong> 10 th<br />

bits.<br />

Character reception<br />

During an USART reception, data shifts in least significant bit first through the RX pin. In this<br />

mode, the USART_DR register consists of a buffer (RDR) between the internal bus <strong>and</strong> the<br />

received shift register.<br />

Procedure:<br />

Doc ID 13902 Rev 9 661/995

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

Saved successfully!

Ooh no, something went wrong!