English
Language : 

DS80C320-MCG Datasheet, PDF (132/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
TIMER/COUNTER 2 BAUD RATE GENERATOR MODE Figure 11-6
TIMER 1
OVERFLOW
OSC INPUT TO TIMER
CLK MODE TIMER INPUT
DIVIDE BY 4 OSC/2
PMM1
OSC/82
PMM2
OSC/512
T2 = P1.0
TR2 = T2CON.2
T2EX = P1.1
EXEN2 = T2CON.3
C/ T2 = T2COD.1
0
CLK
DIVIDE
BY 2
0
SMOD =
WDCON.7
1
1
RCLK =
0
78
15 T2CON.5
TL2
TH2
1
0
DIVIDE
TCLK =
BY 16
T2CON.4
Rx
RCAP2L RCAP2H
1
0
78
15
0
DIVIDE
CLOCK
BY 16
EXF2 =
T2CON.6
TIMER 2
INTERRUPT
Tx
CLOCK
Timer Output Clock Generator
Timer 2 can also be configured to drive a clock output on port pin P1.0 (T2) as shown in Figure 11-7. To
configure Timer 2 for this mode, first it must be set to 16-bit auto-reload timer mode (CP/ RL2 = 0,
C/ T2 = 0). Next, the T2OE (T2MOD.1) bit must be set to a logic 1. TR2 (T2CON.2) must also be set to
a logic 1 to enable the timer.
This mode will produce a 50% duty cycle square wave output. The frequency of the square wave is given
by the formula in the figure. Each timer overflow causes an edge transition on the pin, i.e., the state of
the pin toggles.
Note that this mode has two somewhat unique features in common with the baud rate generation mode.
First, the timebase is the crystal frequency divided by 2, and no other divider selection is possible.
Second, the timer itself will not generate an interrupt, but if needed, an additional external interrupt may
be caused using T2EX as described above. Because of the two mode’s similarities, the timer can be used
to generate both an external clock and a baud rate clock simultaneously. Once the clock out mode is
established, either TCLK or RCLK is set to 1, and the RCAP2 registers are loaded, the timer will provide
a clock to both functions.
132 of 175