English
Language : 

DS89C420-QCL Datasheet, PDF (115/139 Pages) Maxim Integrated Products – Ultra-High-Speed Flash Microcontroller User’s Guide
Ultra-High-Speed Flash
Microcontroller User’s Guide
Table 12-5. Timer 1 Input Clock Frequency
SYSTEM CLOCK MODE
Crystal multiply mode 4X
Crystal multiply mode 2X
Divide-by-1 (default)
Power-management mode (/1024)
PMR REGISTER BITS
4X/2X, CD1, CD0
100
000
X01, X10
X11
TIMER 1
INPUT CLOCK FREQUENCY
T1MH,T1M = 00
T1MH,T1M = 01
T1MH,T1M = 1X
OSC / 12
OSC / 1
OSC / 0.25
OSC / 12
OSC / 12
OSC / 2
OSC / 4
OSC / 0.5
OSC / 1
OSC / 3072
OSC / 1024
OSC / 1024
Using timer 1 in the 8-bit autoreload mode, serial port baud rates for mode 1 or 3 can be calculated using the formula below.
Modes 1, 3 baud rate =
2SMOD_x
32
Timer 1 input clock frequency
x
(256 - TH1)
Number of serial bits /
Number of timer 1 rollovers
Timer 1 rollover
frequency
Timer 1 input clock frequency can be found in the previous table, SMOD_x is the logic state of the baud-rate doubler bit for the asso-
ciated UART, and TH1 is the user assigned timer 1 reload value.
Often, users already know what baud rate is desired and only need to calculate the timer reload value. An equation to calculate the
timer reload value, TH1, is as follows:
2SMOD_x x timer 1 input clock frequency
TH1 = 256 -
32 x 5 baud rate
Note that the 8-bit, autoreload mode for timer 1 is the one most commonly used for serial port applications, but that it can actually be configured in any mode, even as a
counter.
Using Timer 2 for Baud-Rate Generation
To use timer 2 as baud-rate generator for serial port 0, the timer is configured in autoreload mode. Then, either the 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 receiver. Thus, serial port 0 can have the transmitter and receiver operating at different baud rates by choosing timer 1 for one data
direction and timer 2 for the other. RCLK and TCLK reside in T2CON.4 and TCON.5, respectively.
Although the timer 2 input clock can be configured similarly to timer 1, it must be placed into a baud-rate generator mode in order to
be used by serial port 0. Setting either RCLK or TCLK to a logic 1 selects timer 2 for baud-rate generation. When this is done, the timer
2 input clock becomes fixed to the oscillator frequency divided by 2. This is compatible with the 80C32. The only exception is when
timer 2 is used for baud-rate generation within power-management mode. For PMM, the system clock (OSC/1024) is used as the input
clock for timer 2. The timer 2 interrupt is automatically disabled when either RCLK or TCLK is set. Also, the TF2 (TCON.7) flag is not
set on a timer rollover. The manual reload pin, T2EX (P1.1), does not cause a reload either. Table 12-6 illustrates this relationship.
Table 12-6. Timer 2 Baud-Rate Generation
SYSTEM CLOCK MODE
Crystal multiply mode 4X
Crystal multiply mode 2X
Divide-by-1 (default)
Power-management mode (/1024)
PMR REGISTER BITS
4X/2X, CD1, CD0
100
000
X01, X10
X11
TIMER 2 INPUT CLOCK FREQUENCY
BAUD-RATE GENERATOR MODE
(RCLK OR TCLK = 1)
OSC / 2
OSC / 2
OSC / 2
OSC / 1024
115 ____________________________________________________________________________________________