beautypg.com

36 timer 2 mode (t2mod), Timed access register (ta), Timer 2 control (t2con) – Maxim Integrated High-Speed Microcontroller User Manual

Page 47: T2mod, Registers to be transferred, Dcen

background image

High-Speed Microcontroller User’s Guide

Rev: 062210

47 of 176

EXEN2
Bit 3

Timer 2 External Enable. This bit enables the capture/ reload function on the T2EX
pin if Timer 2 is not generating baud rates for the serial port.
0 = Timer 2 will ignore all external events at T2EX.
1 = Timer 2 will capture or reload a value if a negative transition is detected on the
T2EX pin.

TR2
Bit 2

Timer 2 Run Control. This bit enables/disables the operation of timer 2. Halting this
timer will preserve the current count in

TH2

,

TL2

.

0 = Timer 2 is halted.
1 = Timer 2 is enabled.

C/

T2

Bit 1

Counter/Timer Select. This bit determines whether timer 2 will function as a timer or
counter. Independent of this bit, timer 2 runs at 2 clocks per tick when used in either
baud-rate generator or clock output mode.
0 = Timer 2 function as a timer. The speed of timer 2 is determined by the T2M bit
(

CKCON

.5).

1 = Timer 2 will count negative transitions on the T2 pin (P1.0).

CP/

RL2

Bit 0

Capture/Reload Select. This bit determines whether the capture or reload function will
be used for timer 2. If either RCLK or TCLK is set, this bit will not function and the
timer will function in an auto-reload mode following each overflow.
0 = Auto-reloads will occur when timer 2 overflows or a falling edge is detected on
T2EX if EXEN2 = 1.
1 = Timer 2 captures will occur when a falling edge is detected on T2EX if EXEN2 = 1.

4.2.36

Timer 2 Mode (T2MOD)

7 6 5 4 3 2 1 0

SFR C9h

— — —

T2OE

DCEN

RW-0

RW-0

R = Unrestricted Read, W = Unrestricted Write, -n = Value after Reset

Bits 7–2

Reserved. Read data will be indeterminate.

T2OE
Bit 1

Timer 2 Output Enable. This bit enables/disables the clock output function of the T2
pin (P1.0).
0 = The T2 pin functions as either a standard port pin or as a counter input for timer 2.
1 = Timer 2 will drive the T2 pin with a clock output if C/

T2

= 0. Also, timer 2

rollovers will not cause interrupts.

DCEN
Bit 0

Down Count Enable. This bit, in conjunction with the T2EX pin, controls the direction
that timer 2 counts in 16-bit auto-reload mode.

DCEN T2EX

DIRECTION

1 1 Up
1 0

Down

0 X Up