Obsolete
Product(s)
- Obsolete
Product(s)
Standard serial interface (UART)
UPSD3254A, UPSD3254BV, UPSD3253B, UPSD3253BV
12.2.1
Baud rates
The baud rate in Mode 0 is fixed:
Mode 0 Baud Rate = fOSC / 12
The baud rate in Mode 2 depends on the value of Bit SMOD = 0 (which is the value on
reset), the baud rate is 1/64 the oscillator frequency. If SMOD = 1, the baud rate is 1/32 the
oscillator frequency.
Mode 2 Baud Rate = (2SMOD / 64) x fOSC
In the UPSD325xx devices, the baud rates in Modes 1 and 3 are determined by the Timer 1
overflow rate.
12.2.2
Using Timer 1 to generate baud rates
When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3 are
determined by the Timer 1 overflow rate and the value of SMOD as follows:
Modes 1 and 3 Baud Rate = (2SMOD / 32) x (Timer 1 overflow rate)
The Timer 1 Interrupt should be disabled in this application. The Timer itself can be
configured for either “timer” or “counter” operation, and in any of its 3 running modes. In the
most typical applications, it is configured for “timer” operation, in the Auto-reload mode (high
nibble of TMOD = 0010B). In that case the baud rate is given by the formula:
Modes 1 and 3 Baud Rate = (2SMOD / 32) x (fOSC / (12 x [256 – (TH1)]))
One can achieve very low baud rates with Timer 1 by leaving the Timer 1 Interrupt enabled,
and configuring the Timer to run as a 16-bit timer (high nibble of TMOD = 0001B), and using
the Timer 1 Interrupt to do a 16-bit software reload.
Figure 21 lists various commonly used
baud rates and how they can be obtained from Timer 1.
12.2.3
Using Timer/counter 2 to generate baud rates
In the UPSD325xx devices, Timer 2 selected as the baud rate generator by setting TCLK
and/or RCLK (see
Figure 21 Timer/ Counter 2 Control Register (T2CON)).
Note:
The baud rate for transmit and receive can be simultaneously different. Setting RCLK and/or
TCLK puts Timer into its Baud Rate Generator mode.
The RCLK and TCLK Bits in the T2CON register configure UART 1. The RCLK1 and TCLK1
Bits in the PCON register configure UART 2.
The Baud Rate Generator mode is similar to the Auto-reload Mmode, in that a roll over in
TH2 causes the Timer 2 registers to be reloaded with the 16-bit value in registers RCAP2H
and RCAP2L, which are preset by software.
1TI
Transmit Interrupt Flag. Set by hardware at the end of the 8th bit time in
Mode 0, or at the beginning of the Stop bit in the other modes, in any serial
transmission. Must be cleared by software
0RI
Receive Interrupt Flag. Set by hardware at the end of the 8th bit time in
Mode 0, or halfway through the Stop bit in the other modes, in any serial
reception (except for SM2). Must be cleared by software
Table 44.
Description of the SCON bits (continued)
Bit
Symbol
Function