
80C196KB USER’S GUIDE
7.0 TIMERS
7.1 Timer1
Timer1 is a 16-bit free-running timer which is incre-
mented every eight state times. An interrupt can be
generated in response to an overflow. It is read through
location 0AH in Window 0 and written in Window 15.
Figure 7-1 shows a block diagram of the timers.
Care must be taken when writing to it if the High Speed
I/O (HSIO) Subsystem is being used. HSO time entries
in the CAM depend on exact matches with Timer1.
Writes to Timer1 should be taken into account in soft-
ware to ensure events in the HSO CAM are not missed
or occur in an order which may be unexpected. Chang-
ing Timer1 with incoming events on the High Speed
Input lines may corrupt relative references between
captured inputs. Further information on the High
Speed Outputs and High Speed Inputs can be found in
Sections 8 and 9 respectively.
7.2 Timer2
Timer2 on the 80C196KB can be used as an external
reference for the HSO unit, an up/down counter, an
external event capture or as an extra counter. Timer2 is
clocked externally using either the T2CLK pin (P2.3)
or the HSI.1 pin depending on the state of IOC0.7.
Timer 2 counts both positive and negative transitions.
The maximum transition speed is once per state time in
the Fast Increment mode, and once every 8 states oth-
erwise. CLKOUT cannot be used directly to clock Tim-
er2. It must first be divided by 2. Timer2 can be read
and written through location 0CH in Window 0. Figure
7-1 shows a block diagram of the timers.
Timer2 can be reset by hardware, software or the HSO
unit. Either T2RST (P2.4) or HSI.0 can reset Timer2
externally depending on the setting of IOC0.5. Figure
7-2 shows the configuration and input pins of Timer2.
Figure 7-3 shows the reset and clocking options for
Timer2. The appropriate control registers can be read
in Window 15 to determine the programmed modes.
However, IOC0.1(T2RST) is not latched and will read
a 1.
Caution should be used when writing to the timers if
they are used as a reference to the High Speed Output
Unit. Programmed HSO commands could be missed if
the timers do not count continuously in one direction.
High Speed Output events based on Timer2 must be
carefully programmed when using Timer2 as an
up/down counter or is reset externally. Programmed
events could be missed or occur in the wrong order.
Refer to section 9 for more information on using the
timers with the High Speed Output Unit.
Capture Register
The value in Timer2 can be captured into the T2CAP-
ture register by a rising edge on P2.7. The edge must be
held for at least one state time as discussed in the next
section. T2CAP is located at 0CH in Window 15. The
interrupt generated by a capture vectors through loca-
tion 2036H.
Fast Increment Mode
Timer2 can be programmed to run in fast increment
mode to count transitions every state time. Setting
IOC2.0 programs Timer2 in the Fast Increment mode.
In this mode, the events programmed on the HSO unit
with Timer2 as a reference will not execute properly
since the HSO requires eight state times to compare
every location in the HSO CAM. With Timer2 as a
reference for the HSO unit, Timer2 transitioning every
state time may cause programmed HSO events to be
missed. For this reason, Timer2 should not be used as a
reference for the HSO if transitions occur faster than
once every eight state times.
Timer2 should not be RESET in the fast increment
mode. All Timer2 resets are synchronized to an eight
state time clock. If Timer2 is reset when clocking faster
than once every 8 states, it may reset on a different
count.
Up/Down Counter Mode
Timer2 can be made to count up or down based on the
Port 2.6 pin if IOC2.1
e
1. However, caution must be
used when this feature is working in conjunction with
the HSO. If Timer2 does not complete a full cycle it is
possible to have events in the CAM which never match
the timer. These events would stay in the CAM until
the CAM is cleared or the chip is reset.
7.3 Sampling on External Timer Pins
The T2UP/DN, T2CLK, T2RST, and T2CAP pins are
sampled during PH1. PH1 roughly corresponds to
CLKOUT low externally. For valid sampling, the in-
puts should be present 30 nsec prior to the rising edge
of CLKOUT or it may not be sampled until the next
CLKOUT. If the T2UP/DN signal changes and be-
comes stable before, or at the same time that the
T2CLK signal changes, the count will go into the new
direction.
36
数控原理与维修
http://www.agreenleaf.cn
Содержание 80C196KB Series
Страница 1: ...November 1990 80C196KB User s Guide Order Number 270651 003 http www agreenleaf cn...
Страница 59: ...80C196KB USER S GUIDE Figure 11 7 Ideal A D Characteristic 270651 37 55 http www agreenleaf cn...
Страница 60: ...80C196KB USER S GUIDE Figure 11 8 Actual and Ideal Characteristics 270651 38 56 http www agreenleaf cn...
Страница 61: ...80C196KB USER S GUIDE Figure 11 9 Terminal Based Characteristic 270651 39 57 http www agreenleaf cn...
Страница 70: ...80C196KB USER S GUIDE Figure 13 5 Reset Sequence 80C196KB Reset Sequence 270651 45 66 http www agreenleaf cn...
Страница 83: ...80C196KB USER S GUIDE 270651 80 Figure 15 14 AC Timing Diagrams 79 http www agreenleaf cn...
Страница 84: ...80C196KB USER S GUIDE 270651 81 270651 84 Figure 15 14 AC Timing Diagrams Continued 80 http www agreenleaf cn...