English
Language : 

MC68HC908KX8 Datasheet, PDF (227/310 Pages) Motorola, Inc – Microcontrollers
Timer Interface Module (TIM)
Functional Description
16.4 Functional Description
Figure 16-1 shows the structure of the TIM. The central component of
the TIM is the 16-bit TIM counter that can operate as a free-running
counter or a modulo up-counter. The TIM counter provides the timing
reference for the input capture and output compare functions. The TIM
counter modulo registers, TMODH and TMODL, control the modulo
value of the TIM counter. Software can read the TIM counter value at any
time without affecting the counting sequence.
The two TIM channels are programmable independently as input
capture or output compare channels.
16.4.1 TIM Counter Prescaler
The TIM clock source can be one of the seven prescaler outputs. The
prescaler generates seven clock rates from the internal bus clock. The
prescaler select bits, PS2–PS0, in the TIM status and control register
select the TIM clock source.
16.4.2 Input Capture
With the input capture function, the TIM can capture the time at which an
external event occurs. When an active edge occurs on the pin of an input
capture channel, the TIM latches the contents of the TIM counter into the
TIM channel registers, TCHxH and TCHxL. The polarity of the active
edge is programmable. Input captures can generate TIM CPU interrupt
requests.
16.4.3 Output Compare
With the output compare function, the TIM can generate a periodic pulse
with a programmable polarity, duration, and frequency. When the
counter reaches the value in the registers of an output compare channel,
the TIM can set, clear, or toggle the channel pin. Output compares can
generate TIM CPU interrupt requests.
MC68HC908KX8 • MC68HC908KX2 • MC68HC08KX8 — Rev. 1.0
MOTOROLA
Timer Interface Module (TIM)
Technical Data
227