UART ModulesMCF5272 ColdFire ® Integrated Microprocessor User’s Manual, Rev. 3Freescale Semiconductor 16-21to improve the accuracy of the clock source as shown in the following example using a 48 MHz CLKINand 230kbs UART baud rate:1. UART Divider= CLKIN / (16 x 2 x UART Baud Rate)= 48E06 / (32 x 230E03)= 6.52= 6 (truncate to lowest whole number)UDU = 0x00, UDL = 0x062. The truncation has resulted in an effective 8.7% error (0.52/6)3. Using the formula Fractional Divider = (truncated remainder * 16)= 0.52 * 16= 8.32= 8 (truncate to nearest whole number)UFPD = 0x084. This now gives an effective total error in the baud rate as:%Error = 100 x (Truncated remainder) / (16 x (UD + UFPD/16)]= 100 x 0.32 / (16 x (6 + 8/16))= 32 / 104= 0.31%16.5.1.2.2 External ClockAn external source clock (URT_CLK) can be used as is or divided by 16.16.5.1.2.3 Autobaud DetectionThe UART can determine the clock rate of a received character stream from the timing of the receivedpattern. If UCRn[ENAB] is set, the autobaud detector searches for a low level on URT_RxD, indicating astart bit. Start-bit length is measured until URT_RxD returns to a high level, then the transmission rate iscalculated and loaded into UDUn, UDLn, and UFPDn.The calculated transmission rate can be determined by reading UABUn and UABLn. Errors may occur inthe calculation of high transmission rates due to distortion effects from the external drivers. If thecalculated rate is inaccurate, UDUn, UDLn, and UFPDn must be written with the appropriate value as soonas possible to ensure that characters are properly received by the UART. The first character is alwayscorrectly captured, even though the transmission rate is not yet calculated.The first character must be an odd character such as ‘a’ or ‘A’ to ensure that it contains an isolated startbit. The parity mode can be determined by monitoring subsequent characters.The process for using the autobaud detector is as follows:• UDUn, UDLn, and UFPDn must be initialized to 0x00.• The receiver and transmitter clock sources must be set to TIMER (UCSR = 0xDD).• Autobaud must be enabled (UCR[ENAB] = 1).• The receiver must be enabled (UCR[RC] = 01).Baudrate Externalclockfrequency16or1---------------------------------------------------------------------=