English
Language : 

MMC2107 Datasheet, PDF (325/618 Pages) –
Freescale Semiconductor, Inc.
Timer Modules (TIM1 and TIM2)
Functional Description
15.8.5 General-Purpose I/O Ports
An I/O pin used by the timer defaults to general-purpose I/O unless an
internal function which uses that pin is enabled.
The timer pins can be configured for either an input capture function or
an output compare function. The IOSx bits in the timer IC/OC select
register configure the timer port pins as either input capture or output
compare pins.
The timer port data direction register controls the data direction of an
input capture pin. External pin conditions trigger input captures on input
capture pins configured as inputs.
To configure a pin for input capture:
1. Clear the pin’s IOS bit in TIMIOS.
2. Clear the pin’s DDR bit in TIMDDR.
3. Write to TIMCTL2 to select the input edge to detect.
TIMDDR does not affect the data direction of an output compare pin. The
output compare function overrides the data direction register but does
not affect the state of the data direction register.
To configure a pin for output compare:
1. Set the pin’s IOS bit in TIMIOS.
2. Write the output compare value to TIMCxH/L.
3. Clear the pin’s DDR bit in TIMDDR.
4. Write to the OMx/OLx bits in TIMCTL1 to select the output action.
Table 15-7. TIMPORT I/O Function
In
Data Direction Output Compare
Register
Action
0
0
0
1
1
1
1
0
Out
Reading
at Data Bus
Reading at Pin
Pin
Pin
Pin
Output compare action
Port data register Output compare action
Port data register Port data register
MMC2107 – Rev. 2.0
MOTOROLA
Timer Modules (TIM1 and TIM2)
For More Information On This Product,
Go to: www.freescale.com
Technical Data
325