ADP315PC87570 National Semiconductor, ADP315PC87570 Datasheet - Page 110

no-image

ADP315PC87570

Manufacturer Part Number
ADP315PC87570
Description
Keyboard and Power Management Controller
Manufacturer
National Semiconductor
Datasheet
Mode 2, Dual Input Capture
Dual capture mode can be used to precisely measure the
frequency of an external clock that is slower than the select-
ed clock source frequency, or to measure the elapsed time
between external events. A transition received on the TA or
TB pin causes a transfer of the timer/counter 1 contents to
the TCRA or TCRB register, respectively. In this mode tim-
er/counter 2 can be utilized as a system timer which is pre-
loaded by the user software and will generate an interrupt
on underflow.
Figure 14-5 shows a block diagram of the timer operating in
mode 2. In this mode of operation the timebase of the cap-
ture timer is formed by counter I, which counts down with
the clock selected via the counter 1 clock selector. In the
dual-input capture mode, the TA and TB pins function as
capture inputs. A transition received on the TA pin causes a
transfer of the timer contents to the TCRA register. Similar-
ly, a transition received on the TB pin causes a transfer of
the timer contents to the TCRB register.
The TA and TB inputs can be configured to perform a
counter preset to FFFFh on reception of a valid capture
event. In this case the current value of the counter is trans-
ferred to the corresponding capture register and then the
counter is preset to FFFFh. Using this approach allows you
to determine directly the on-time, off-time, or period of an
external signal while reducing CPU overhead.
The pulse width of the input signal on TA and TB must be
equal to or greater than one system clock cycle. (See the
AC Electrical Specs in Chapter 3 for additional details.) The
Timer1
Timer 2
Clock
Clock
Timer/Counter 1
Timer/Counter 2
Capture A
Capture B
TCNT1
Figure 14-5. Mode 2, Dual Input Capture
TCRA
TCNT2
TCRB
Multi-Function 16-Bit Timer (MFT16)
Preset
Preset
110
Underflow
Underflow
TAEN
TBEN
values captured in the TCRA register at different times re-
flect the elapsed time between transitions on the TA pin.
The same is true for the TCRB register and TB pin. Each in-
put pin can be configured to sense either positive-going or
negative-going transitions.
The timer can be configured to generate interrupts on re-
ception of a transition on either TA or TB, which can en-
abled or disabled separately by the TAIEN and TBIEN bits.
An underflow of TCNT1 can also generate an interrupt, if
enabled by the TCIEN bit. All three interrupts have individ-
ual pending flags associated with them. (See Section 14.4.2
on page 113 for detailed information.)
The second timer/counter 2 can be used as a simple system
timer in this mode of operation. The counter TCNT2 counts
down with the clock selected via the counter 2 clock selec-
tor, and can be configured to generate an interrupt on un-
derflow, if enabled by the TDIEN bit. (See Section 14.4.2 on
page 113 for detailed information.)
Note that TCNT1 cannot operate in the “Pulse Accumulate”
or “External Event Counter” modes of operations since the
TB input is used as a capture input. Selecting either “Pulse
Accumulate” mode or “External Event Counter” mode for
TCNT1 causes TCNT1 to stop.
However, all available clock source modes may be selected
for TCNT2. Thus it is possible to determine the number of
capture events on TB, or the elapsed time between capture
events on TB by using TCNT2.
TCIEN
TCPND
TAIEN
TAPND
TBIEN
TDIEN
TBPND
TDPND
Interrupt 1
Interrupt 1
Interrupt 1
Interrupt 2
Timer
Timer
Timer
Timer
TB
TA
www.national.com

Related parts for ADP315PC87570