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.

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

RM0008<br />

Figure 244. Mute mode using Idle line detection<br />

RXNE<br />

RXNE<br />

RX Data 1 Data 2 Data 3 Data 4 IDLE<br />

Data 5 Data 6<br />

RWU<br />

Mute Mode<br />

Normal Mode<br />

RWU written to 1<br />

Idle frame detected<br />

Address mark detection (WAKE=1)<br />

In this mode, bytes are recognized as addresses if their MSB is a ‘1’ else they are<br />

considered as data. In an address byte, the address of the targeted receiver is put on the 4<br />

LSB. This 4-bit word is compared by the receiver with its own address which is programmed<br />

in the ADD bits in the USART_CR2 register.<br />

The USART enters mute mode when an address character is received which does not<br />

match its programmed address. In this case, the RWU bit is set by hardware. The RXNE flag<br />

is not set for this address byte <strong>and</strong> no interrupt nor DMA request is issued as the USART<br />

would have entered mute mode.<br />

It exits from mute mode when an address character is received which matches the<br />

programmed address. Then the RWU bit is cleared <strong>and</strong> subsequent bytes are received<br />

normally. The RXNE bit is set for the address character since the RWU bit has been cleared.<br />

The RWU bit can be written to as 0 or 1 when the receiver buffer contains no data (RXNE=0<br />

in the USART_SR register). Otherwise the write attempt is ignored.<br />

An example of mute mode behavior using address mark detection is given in Figure 245.<br />

Figure 245. Mute mode using Address mark detection<br />

In this example, the current address of the receiver is 1<br />

(programmed in the USART_CR2 register)<br />

RXNE<br />

RXNE<br />

RX<br />

IDLE<br />

Addr=0<br />

Data 1 Data 2 IDLE Addr=1 Data 3 Data 4 Addr=2 Data 5<br />

RWU<br />

Mute Mode<br />

Normal Mode<br />

Mute Mode<br />

RWU written to 1<br />

(RXNE was cleared)<br />

Non-matching address<br />

Matching address<br />

Non-matching address<br />

25.3.7 Parity control<br />

Parity control (generation of parity bit in transmission <strong>and</strong> parity checking in reception) can<br />

be enabled by setting the PCE bit in the USART_CR1 register. Depending on the frame<br />

length defined by the M bit, the possible USART frame formats are as listed in Table 177.<br />

668/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!