MSM80C154S/83C154S/85C154HVS

4.5.3Timer/counter 2 4.5.3.1 Outline

Timer/counter 2 is equipped with 16-bit binary counting and Read/Write functions. This timer/ counter is controlled entirely by timer 2 control register (T2CON 0C8H).

The operating modes are 16-bit auto reload mode, capture mode, and baud rate generator mode. Modes are specified by T2CON RCLK, TCLK, and CP/RL2 bits combinations.

The internal or external clock applied to the timer/counter 2 is specified by the C/T2 bit. And starting and stopping of timer/counter 2 counting is controlled by the TR2 bit. Note that timer/ counter 2 counting is stopped in CPU power down mode where XTAL1·2 are stopped.

4.5.3.2 Timer 2 control register (T2CON)

The timer 2 control register (T2CON 0C8H) consists of the timer/counter 2 control bits, timer 2 internal flag (TF2), and timer 2 external flag (EXF2). The T2CON contents are outlined in Table 4-12.

Table 4-12 Timer 2 control register (T2CON 0C8H)

Bit

 

 

7

 

6

 

5

4

3

 

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag

 

 

TF2

 

EXF2

 

RCLK

TCLK

EXEN2

 

TR2

C/ T2

CP/ RL2

 

 

 

 

 

 

 

 

 

 

 

 

 

CP/RL2

:

Capture mode is set when TCLK+RCLK=0 and CP/RL2=1. The timer/counter

 

 

2 contents are passed to the capture register (RCAP2L/RCAP2H) when the

 

 

level o the signal applied to the T2EX pin (bit 1 of port 1) is changed from “1” to

 

 

“0” with EXEN2-1.

 

 

 

 

 

 

 

 

 

 

16-bit auto reload mode is set when TCLK+RCLK=0 and CP/RL2=0. The CP/

C/T2

 

RL2 data is ignored when TCLK+RCLK=1.

 

 

 

 

:

Timer/counter 2 clock input designation bit.

 

 

 

 

 

 

The internal clock is specified when this bit is “0” and the external clock is

 

 

specified

 

 

 

 

 

 

 

 

 

 

 

 

when “1”.

 

 

 

 

 

 

 

 

 

 

TR2

:

Timer/counter 2 counting start and stop control bit.

 

 

 

 

 

 

Timer/counter 2 operation is stopped when this bit is “0”, and enabled when “1”

EXEN2

:

The T2EX pin control bit. The signal applied to the T2EX pin is invalid when this

 

 

bit is “0”, and valid when “1”.

 

 

 

 

 

 

TCLK

:

Serial port transmit clock control bit. When this bit is set to “1”, timer/counter 2

 

 

is set to 16-bit auto reload operation mode, and the timer/counter 2 carry signal

 

 

activates the serial port transmit circuit. This clock is only valid when serial port

 

 

mode 1 or 3 has been set.

 

 

 

 

 

 

 

RCLK

:

Serial port receive clock control bit. When this bit is set to “1”, timer/counter 2

 

 

is set to 16-bit auto reload operation mode, and the timer/counter 2 carry signal

 

 

activates the serial port receive circuit.

 

 

 

 

 

 

 

 

This clock is only valid when serial port mode 1 or 3 has been set.

 

 

92

Page 99
Image 99
Sonic Alert msm83c154s, msm80154s Bit is 0, and valid when, Mode 1 or 3 has been set, Timer 2 control register T2CON 0C8H