09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

26.3.3 Receiver<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 />

The start bit detection sequence is the same when oversampling by 16 or by 8.<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 0 X 0 0 0 0.<br />

Figure 249. Start bit detection when oversampling by 16 or 8<br />

RX state<br />

RX line<br />

Ideal<br />

sample<br />

clock<br />

Real<br />

sample<br />

clock<br />

Conditions<br />

to validate<br />

the start bit<br />

1<br />

1<br />

Falling edge<br />

detection<br />

Idle Start bit<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 />

7/16<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 />

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

idle state (no flag is set) where it waits for a falling edge.<br />

The start bit is confirmed (RXNE flag set, interrupt generated if RXNEIE=1) if the 3 sampled<br />

bits are at 0 (first sampling on the 3rd, 5th and 7th bits finds the 3 bits at 0 and second<br />

sampling on the 8th, 9th and 10th bits also finds the 3 bits at 0).<br />

The start bit is validated (RXNE flag set, interrupt generated if RXNEIE=1) but the NE noise<br />

flag is set if, for both samplings, at least 2 out of the 3 sampled bits are at 0 (sampling on the<br />

3rd, 5th and 7th bits and sampling on the 8th, 9th and 10th bits). If this condition is not met,<br />

the start detection aborts and the receiver returns to the idle state (no flag is set).<br />

If, for one of the samplings (sampling on the 3rd, 5th and 7th bits or sampling on the 8th, 9th<br />

and 10th bits), 2 out of the 3 bits are found at 0, the start bit is validated but the NE noise<br />

flag bit is set.<br />

6/16<br />

7/16<br />

ai15471<br />

Doc ID 018909 Rev 3 746/1416

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

Saved successfully!

Ooh no, something went wrong!