Datasheet
Timer Module
MOTOROLA MCF5206e USER’S MANUAL 14-3
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1
14.3.1 Selecting the Prescaler
You 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 the AC Electrical Specs section.
The ICLK 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.
14.3.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 Timer Event Register (TER) bit and issues a maskable interrupt.
14.3.3 Configuring the Timer for Reference Compare
You 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 TER bit is set
and issues an interrupt if the output reference interrupt (ORI) enable bit in TMR is set.
14.3.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.
14.4 PROGRAMMING MODEL
14.4.1 Understanding the General-Purpose Timer Registers
You can modify the timer registers at any time. Table 14-1 illustrates the programming
model.
Table 14-1. Programming Model for Timers
TIMER 1 ADDRESS TIMER 2 ADDRESS TIMER MODULE REGISTERS
MBAR+$100 MBAR+$120 Timer Mode Register (TMR)
MBAR+$104 MBAR+$124 Timer Reference Register (TRR)
MBAR+$108 MBAR+$128 Timer Capture Register (TCR)
MBAR+$10C MBAR+$12C Timer Counter (TCN)
MBAR+$111 MBAR+$131 Reserved Timer Event Register (TER)
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
