Datasheet

Data Sheet ADuC7124/ADuC7126
Rev. C | Page 61 of 108
Baud Rate Generation
There are two ways of generating the UART baud rate, using
normal 450 UART baud rate generation and using the fractional
divider.
Normal 450 UART Baud Rate Generation
The baud rate is a divided version of the core clock using the value
in the COMxDIV0 and COMxDIV1 MMRs (16-bit value, DL).
DL
RateBaud
CD
×××
=
2162
MHz78.41
Tabl e 91 gives some common baud rate values.
Table 91. Baud Rate Using the Normal Baud Rate Generator
Baud Rate CD DL Actual Baud Rate % Error
9600 0 0x88 9600 0
19,200 0 0x44 19,200 0
115,200 0 0x0B 118,691 3
9600 3 0x11 9600 0
19,200 3 0x08 20,400 6.25
115,200 3 0x01 163,200 41.67
The Fractional Divider
The fractional divider, combined with the normal baud rate
generator, produces a wider range of more accurate baud rates.
09123-032
÷ 16DL UART
FBEN
CORE
CLOCK
÷ 2
÷ (M + N ÷ 2048)
Figure 48. Baud Rate Generation Options
Calculation of the baud rate using fractional divider is as follows:
+××××
=
2048
2162
MHz78.41
N
MDL
RateBaud
CD
2162
MHz78.41
2048
××××
=+
DLRateBaud
N
M
CD
For example, generation of 19,200 baud with CD bits = 3
(Tabl e 91 gives DL = 0x08) is
28162200,19
MHz78.41
2048
3
××××
=+
N
M
06.1
2048
=+
N
M
where:
M = 1.
N = 0.06 × 2048 = 128.
××××
=
2048
128
28162
MHz78.41
3
RateBaud
where:
Baud Rate = 19,200 bps.
Error is 0%, compared to 6.25% with the normal baud rate
generator.
UART Register Definitions
COM0TX Register
Name: COM0TX
Address: 0xFFFF0700
Default Value: 0x00
Access: Read/write
COM0TX is an 8-bit transmit register for UART0.
COM1TX Register
Name: COM1TX
Address: 0xFFFF0740
Default Value: 0x00
Access: Read/write
COM1TX is an 8-bit transmit register for UART1.
COM0RX Register
Name: COM0RX
Address: 0xFFFF0700
Default Value: 0x00
Access: Read only
COM0RX is an 8-bit receive register for UART0.
COM1RX Register
Name: COM1RX
Address: 0xFFFF0740
Default Value: 0x00
Access: Read only
COM1RX is an 8-bit receive register for UART1.
COM0DIV0 Register
Name: COM0DIV0
Address: 0xFFFF0700
Default Value: 0x00
Access: Read/write
COM0DIV0 is a low byte divisor latch for UART0. COM0TX,
COM0RX, and COM0DIV0 share the same address location.
COM0TX and COM0RX can be accessed when Bit 7 in the
COM0CON0 register is cleared. COM0DIV0 can be accessed
when Bit 7 of COM0CON0 is set.