English
Language : 

DS80C320-MCG Datasheet, PDF (144/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
Mode 1 or 3
These asynchronous modes are commonly used for communication with PCs, modems, and other similar
interfaces. The baud rates are programmable using the oscillator input and 16-bit Timer 2 or 8-bit Timer
1. The respective timer is placed in auto-reload mode. Each time the timer reaches its rollover condition
(FFFFh -Timer 2 or FFh - Timer 1), a clock is sent to the baud rate circuit. This clock is then divided by
16 to generate the exact baud rate. For Serial Port 0, either Timer 1 or 2 can be used to generate baud
rates. Note that there are difdivider regisferences between the timers when used as baud rate generators.
Serial Port 1 can use Timer 1 as a baud rate generator. Thus in Mode 1 or 3, the two serial ports can
run at the same frequency if Timer 1 is used for both, but different frequencies if both timers are used.
Also note that the user can determine the speed at which Timer 1 runs (4 clocks or 12 clocks). In most
cases, 12 clocks will be used for baud rate generation. Timer 2 runs from a 2 clock scheme when used for
baud rate generation. This is compatible with the 80C32.
The baud rates for Mode 1 or 3 are given by these formulas.
Serial Port 0 or 1
2 SMOD_x
Mode 1, 3 baud rate = 32 * Timer 1 Overflow
Serial Port 0
Timer 2 Overflow
Mode 1, 3 baud rate =
16
To use Timer 1 as the baud rate generator, it is commonly put into the 8-bit auto-reload mode. In this
way, the CPU is not involved in baud rate generation. Note that the timer interrupt should not be enabled.
In the 8-bit auto-reload mode (Timer 1 Mode 2), the reload value is stored in TH1. Thus the combination
of crystal frequency and TH1 determine the baud rate. The complete formula is as follows.
Mode 1, 3 baud rate =
2 SMOD_x
32
*
Oscillator Frequency
12 * (256 - TH1)
Note that the 12 in the denominator can be changed to a 4 as determined by the Timer selection (T1M;
CKCON.4). This formula provides the derived baud rate for a given TH1 and crystal. Most users already
know what baud rate is desired and want the timer reload value. Thus the equation solves as follows,
when T1M=0.
2 SMOD_x * Oscillator Frequency
TH1 = 256 -
32* Baud Rate
Note that the most common application is to use Timer 1 in 8-bit auto-reload mode as a timer. It can
actually be used in any mode and can also be configured as a counter.
To use Timer 2 as baud rate generator for Serial Port 0, the Timer is configured in auto-reload mode.
Then either TCLK or RCLK bit (or both) are set to a logic 1. TCLK = 1 selects Timer 2 as the baud rate
generator for the transmitter and RCLK = 1 selects Timer 2 for the Thus Serial Port 0 can have the
transmit and receive operating at different baud rates by choosing 1 for one data direction and Timer 2 for
144 of 175