MCMC68HC05L16 Freescale Semiconductor, Inc, MCMC68HC05L16 Datasheet - Page 89

no-image

MCMC68HC05L16

Manufacturer Part Number
MCMC68HC05L16
Description
M68hc05 Microcontrollers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
9.3.6 Timer Input 2 (EVI)
The event input (EVI) is used as an external clock input for timer 2.
Since the external clock may be asynchronous to the internal clock, this input has a synchronizer which
samples external clock by the internal system clock. (The input transition synchronizes to the falling edge
of PH2. Therefore, to be measured, the minimum pulse width for EVI must be larger than one system
clock.)
The IM2 and IL2 bits in the TCR2 determine how this synchronized external clock is used. The IM2 bit
decides between event mode and gate mode, and the IL2 bit decides which level or edge is activated.
In event mode (IM2 = 0), the external clock drives the timer 2 counter directly and the active edge at the
EVI pin is selected by the IL2 bit. When an active edge is detected, the TI2F bit in the TCR2 is set.
In gate mode (IM2 = 1), the EVI input is gated by CLK2 from the prescaler and gate output drives the timer
2 counter. The IL2 bit decides active level of the external input. When the transition from active level to
inactive level is detected, the TI2F bit is set.
Changing the IM2 bit may cause an illegal count up of TCNT2, thus presetting TCNT2 after initializing IM2
is required.
Freescale Semiconductor
Since the EVI pin is shared with the PC4 I/O pin, DDRC4 should always be
cleared whenever EVI is used. EVI should not be used when DDRC4 is
high.
PC4
EVI
IM2
0
0
1
1
MC68HC05L16 • MC68HC705L16 Data Sheet, Rev. 4.1
PC4
IL2
0
1
0
1
Figure 9-13. EVI Block Diagram
SYNC
Falling edge of EVI increments counter
Rising edge of EVI increments counter
Low level on EVI enables counting
High level on EVI enables counting
Table 9-3. EVI Modes Selection
PH2
EDGE/LEVEL
SELECTOR
IL2
NOTE
ACTIVE
Action on Clock
GATE/EVENT
CONTROL
IM2
MODE
CLK2
TO TI2F
EXCLK
Timer 2
89

Related parts for MCMC68HC05L16