User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 586
UG585 (v1.11) September 27, 2016
Chapter 19: UART Controller
The baud rate generator can use either the master clock signal, uart_ref_clk, or the master clock
divided by eight, uart_ref_clk/8. The clock signal used is selected according to the value of the CLKS
bit in the Mode register (uart.mode_reg0). The resulting selected clock is termed sel_clk in the
following description.
The sel_clk clock is divided down to generate three other clocks: baud_sample, baud_tx_rate, and
baud_rx_rate. The baud_tx_rate is the target baud rate used for transmitting data. The baud_rx_rate
is nominally at the same rate, but gets resynchronised to the incoming received data. The
baud_sample runs at a multiple ([BDIV] + 1) of baud_rx_rate and baud_tx_rate and is used to
over-sample the received data.
The sel_clk clock frequency is divided by the CD field value in the Baud Rate Generator register to
generate the baud_sample clock enable. This register can be programmed with a value between 1
and 65535.
The baud_sample clock is divided by [BDIV] plus 1. BDIV is a programmable field in the Baud Rate
Divider register and can be programmed with a value between 4 and 255. It has a reset value of 15,
inferring a default ratio of 16 baud_sample clocks per baud_tx_clock / baud_rx_rate.
Thus the frequency of the baud_sample clock enable is shown in Equation 19-1.
Equation 19-1
The frequency of the baud_rx_rate and baud_tx_rate clock enables is show in Equation 19-2.
Equation 19-2
IMPORTANT: It is essential to disable the transmitter and receiver before writing to the Baud Rate
Generator register (uart.Baud_rate_gen_reg0), or the baud rate divider register
(uart.Baud_rate_divider_reg0). A soft reset must be issued to both the transmitter and receiver before
they are re-enabled.
Some examples of the relationship between the uart_ref_clk clock, baud rate, clock divisors (CD and
BDIV), and the rate of error are shown in Table 19-1. The highlighted entry shows the default reset
X-Ref Target - Figure 19-3
Figure 19-3: UART Board Rate Generator
uart.mode_reg0[0]
Divide
by 8
CD
Programmable
Divider
sel_clk
UART Ref clock
Rx and Tx
Baud rate
UG585_c19_03_071912
0
1
Sel
Clk
uart.Baud_rate_gen_reg0[15:0]
BDIV
Programmable
Divider
uart.Baud_rate_divider_reg0[7:0]
Baud
Sample
baud_sample
sel_clk
CD
---------------
=
baud_rate
sel_clk
CD BDIV 1+()×
------------------------------------
=