
Figure 15 :
A Conceptual Circuit of theMFP Timers in the Pulse Width Measurement Mode.
Changing the prescale value with the timer running
can cause the first Time Out pulse to occur at an in-
determinate time, (no less than one nor more than
200 timerclock cycles times the number in the time
constantregister), but subsequent Time Out pulses
will then occurat thecorrect interval.
In addition to the delay mode described above, Ti-
mers A and B can also function in the Pulse Width
Measurement mode or in the EventCount mode. In
eitherofthesetwomodes, an auxiliarycontrolsignal
is required. The auxiliary control input forTimer Ais
TAI,andforTimerB,TBIisused.Theinterruptchan-
nels associatedwith 14 and13are usedfor TAIand
TBI, respectively, in Pulse Width mode. See Figure
15.
The pulse width measurement mode functions
much like the delay mode. However, in this mode,
the auxiliary control signal on TAI or TBI acts as an
enable to the timer.When the control signalon TAI
or TBI is inactive, the timerwill be stopped. When it
is active,theprescaler andmaincounter areallowed
to run. Thusthe width of the active pulse on TAI or
TBI is determined by the number of timer counts
which occur while the pulse allows the timer to run.
The active state of the signal on TAI or TBI is de-
pendent upon the associated Interrupt Channel’s
edge bit (GPIP 4 for TAI and GPIP 3 for TBI : see
Active Edge Register in figure5). If the edge bit as-
sociated with the TAI or TBI input is a one, it will be
active high ; thus the timer will be allowed to run
when theinput is at a highlevel. If the edgebit is a
zero, the TAI orTBI input will be active low. As pre-
viously stated, the interrupt channel (13 or 14) as-
sociated with the input still functions when the timer
isusedinthe pulsewidth measurement mode.How-
ever, if the timer is programmed for the pulse width
measurementmode, theinterrupt causedbytran-si-
tions ontheassociatedTAI orTBI inputwilloccuron
theopposite transition.
For example, if theedgebit associated with the TAI
input (AER-GPIP 4) is as one, an interrupt would
normally be generatedon the0-1transition of the14
input signal. If the timer associated with this input
(Timer A) isplaced in the pulse width measurement
mode, the interrupt will occur on the 1-0 tran-sition
of the TAI signal instead. Because the edge bit
(AER-GPIP 4) is a one, Timer A will be allowed to
count while the input is high. When the TAI input
makes the high to low transition, Timer A willstop,
and it is at this point that theinterrupt will occur (as-
suming that the channel isenabled). Thisallows the
interrupt tosignalthe CPUthatthepulse being mea-
sured has terminated ; thus Timer A may now be
readto determine the pulse width.(Again note that
13 and 14 may still be used for I/O when the timer
is in the pulse width measurement mode). If Timer
V000332
MK68901
12/33