General-Purpose Timer Registers
MOTOROLA
Timer Module
11-3
11.4.1
SELECTING THE PRESCALER
Users can select the prescalar clock from the main clock (divided by 1 or by 16) or from the corresponding
timer input TIN pin. TIN is synchronized to the internal clock. The synchronization delay is between two
and three main clocks. TIN must meet the setup time spec shown in
Table 21-10 in Section 21.
The CLK bits of the corresponding Timer Mode Register (TMR) select the clock input source. The
prescaler is programmed to divide the clock input by values from 1 to 256. The prescalar output is used as
an input to the 16-bit counter.
11.4.2
CAPTURE MODE
The timer has a 16-bit Timer Capture Register (TCR) that latches the counter value when the
corresponding input capture-edge detector senses a defined transition of TIN. The capture edge (CE) bits
in the TMR select the type of transition triggering the capture. A capture event sets the CAP bit in the Timer
Event Register (TER) and issues a maskable interrupt.
11.4.3
CONFIGURING THE TIMER FOR REFERENCE COMPARE
Users can configure the timer to count until it reaches a reference value at which time it either starts a new
time count immediately or continues to run. The free run/restart (FRR) bit of the TMR selects either mode.
When the timer reaches the reference value, the REF bit in the TER register is set and issues an interrupt
if the output reference interrupt (ORI) enable bit in TMR is set.
11.4.4
CONFIGURING THE TIMER FOR OUTPUT MODE
The timer can send an output signal on the timer output (TOUT) pin when it reaches the reference value as
selected by the output mode (OM) bit in the TMR. This signal can be an active-low pulse or a toggle of the
current output under program control.
11.5
GENERAL-PURPOSE TIMER REGISTERS
Users can modify the timer registers at any time.
Table 11-1 shows the timer programming model.
Table 11-1 Programming Model for Timers
TIMER 0
ADDRESS
TIMER 1
ADDRESS
TIMER MODULE REGISTERS
MBAR+$140
MBAR+$180
Timer Mode Register (TMRn)
MBAR+$144
MBAR+$184
Timer Reference Register (TRRn)
MBAR+$148
MBAR+$188
Timer Capture Register (TCRn)
MBAR+$14C
MBAR+$18C
Timer Counter (TCNn)
MBAR+$151
MBAR+$191
Reserved
Timer Event Register (TERn)
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.