English
Language : 

COP888GW Datasheet, PDF (16/44 Pages) National Semiconductor (TI) – 8-Bit Microcontroller with Pulse Train Generators
Timers (Continued)
INITIALIZATION
The user should perform the following initialization prior to
starting the capture timer
1 Reset the CMxRUN bit
2 Configure the corresponding Port bits as inputs
3 Set the edge control bits CMxEC
4 Reset CMxIP1 (CMxIP1 e 0)
5 Reset CMxIP2 (CMxIP2 e 0)
6 Load the 8-bit prescaler register CMxPSC with the de-
sired value (from 0 to 255)
7 Set CMxIEN (if interrupts are to be used)
8 Set the Global Interrupt Enable (GIE) bit (if interrupts are
to be used)
9 Set CMxRUN bit to start the capture timer
WARNING
In order to avoid erroneous interrupts the capture timer in-
terrupts must be disabled prior to setting resetting the cap-
ture edge control bits (CMxEC) In addition after selecting
the interrupt edge the pending flags must be reset before
the capture interrupts are enabled or re-enabled If the ini-
tialization sequence outlined above is followed each time
the user aIters the edge control bits the user is guaranteed
to avoid erroneous interrupts
Pulse Train Generators
This device contains four independent pulse train genera-
tors Each individual generator is controlled by a corre-
sponding 16-bit counter Each counter has a 16-bit prescal-
er and a 16-bit count register Each counter may be config-
ured to output a selected number of 50% duty cycle pulses
The contents of the prescaler determine the width of the
output pulses and the value of the count register deter-
mines the number of pulses Each counter may be stopped
started under software control and each counter may be
configured to interrupt the microcontroller on an underflow
Figure 11 shows the pulse train generator 1 block diagram
FIGURE 11 Pulse Train Generator 1 Block Diagram
TL DD 12065 – 12
http www national com
16