Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

Universal asynchronous receiver transmitter (UART)

RM0016

 

 

22.3.4High precision baud rate generator

The receiver and transmitter (Rx and Tx) are both set to the same baud rate programmed by a 16-bit divider UART_DIV according to the following formula:

Tx/ Rx baud rate =

fMASTER

UART_DIV

The UART_DIV baud rate divider is an unsigned integer, coded in the BRR1 and BRR2 registers as shown in Figure 119.

Refer to Table 54. for typical baud rate programming examples.

Figure 119. How to code UART_DIV in the BRR registers

Example: To obtain 9600 baud with fMASTER = 10 MHz.

UART_DIV = 10 000 000/9600

UART_DIV = 1042d = 0x0412 See Table 54.

 

 

 

 

 

0x41

 

0x0

 

 

0x2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UART_DIV[11:4]

 

UART_DIV[15:12]

 

UART_DIV[3:0]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

0

 

7

 

 

4 3

 

 

0

 

 

 

 

UART_BRR1

 

 

UART_BRR2

 

 

 

 

 

 

register = 0x41

 

 

register = 0x02

 

 

 

 

Note:

The Baud Counters will be updated with the new value of the Baud Registers after a write to

 

BRR1. Hence the Baud Register value should not be changed during a transaction. The

 

BRR2 should be programmed before BRR1.

 

 

 

 

 

 

 

 

 

 

Note:

UART_DIV must be greater than or equal to 16d.

 

 

 

 

 

 

 

 

 

 

322/454

Doc ID 14587 Rev 9

Соседние файлы в папке Минимум документации STM8_1