cop87l88rw National Semiconductor Corporation, cop87l88rw Datasheet - Page 16
![no-image](/images/no-image-200.jpg)
cop87l88rw
Manufacturer Part Number
cop87l88rw
Description
8-bit One-time Programmable Otp Microcontroller With Pulse Train Generators And Capture Modules
Manufacturer
National Semiconductor Corporation
Datasheet
1.COP87L88RW.pdf
(42 pages)
http
Pulse Train Generators
The four 8-bit registers shown in each individual counter in
the block diagram constitute a 16-bit prescaler and a 16-bit
count register These registers are all read writable and
may be accessed through the data memory address data
bus The registers are designated as
CxPRL Low-byte of the Prescaler
CxPRH High-byte of the Prescaler
CxCTL Low-byte of the Count Register
CxCTH High-byte of the Count Register
CONTROL REGISTER BITS
The control bits for Counter 1 and Counter 2 are contained
in the CCR1 register The CCR1 Register bits are
C1RUN COUNTER1 start stop control bit (1
C1IEN
C1IPND COUNTER1 interrupt pending bit (1
C1TM
C2RUN COUNTER2 start stop control bit (1
C2IEN
C2IPND COUNTER2 interrupt pending bit (1
C2TM
All interrupt pending bits must be reset by software
The control bits for Counter 3 and Counter 4 are contained
in the CCR2 register The CCR2 Register bits are
C3RUN
C3IEN
C3IPND COUNTER3 interrupt pending Bit (1
C3TM
C4RUN
C2TM
www national com
Bit 7
stop)
COUNTER1 interrupt enable control bit (1
able IRQ)
underflowed)
COUNTER1 test mode control bit (1
path in test mode This bit is reserved during nor-
mal operation and must never be set to one )
stop)
COUNTER2 interrupt enable control bit (1
able IRQ)
underflowed)
COUNTER2 test mode control bit (1
path This bit is reserved during normal operation
and must never be set to one )
IPND
COUNTER3 start stop control bit (1
stop)
COUNTER3 interrupt enable control bit (1
able IRQ)
underflowed)
COUNTER3 test mode control bit (1
path This bit is reserved during normal operation
and must never be set to one )
COUNTER4 start stop control bit (1
stop)
C2
IEN
C2
RUN
C2
C1TM
(Continued)
IPND
C1
e
e
e
e
e
e
e
e
e
e
IEN
C1
special test
special test
special test
start 0
start 0
start 0
counter 3
start 0
counter 1
counter 2
e
e
e
RUN
Bit 0
C1
en-
en-
en-
e
e
e
e
16
13 ) This signal causes the port pin to toggle In addition the
C4IEN
C4IPND COUNTER4 interrupt pending bit (1
C4TM
All interrupt pending bits must be reset by software
FUNCTIONAL DESCRIPTION
The pulse train generator may be used to produce a series
of output pulses of a given width The high low time of a
pulse is determined by the contents of the prescaler The
number of pulses in a series is determined by the contents
of the count register
The prescaler is loaded with a value corresponding to the
desired width of the output pulse (t
time of the output signal are each equal to t
output signal produced has a 50% duty cycle and a period
equal to 2
determined using the following equation
Since PRH and PRL are both 8-bit registers this equation
allows a maximum t
t
and PRL when the counter start stop bit is set
The count register is loaded with a value corresponding to
the desired number of output pulses The appropriate count
value is calculated with the following equation
The port pin associated with the counter OUT signal is con-
figured in software as an output and preset to the desired
start logic level lf interrupts are to be used the counter
interrupt pending bit is cleared and the interrupt enable bit is
set The GIE bit must also be set to enable interrupts The
interrupt signals from the four counters are gated to a single
interrupt vector located at addresses 0xF0 – 0xF1
The counter is started by writing a ‘‘1’’ to the counter start
stop bit This resets the divide-by-2 counter which produces
the clock signal for the counter register from the prescaler
underflow (See Figure 12 ) It also reloads the internal pre-
scaler and starts the prescaler counting down on the next
rising edge of t
of t
edge of t
the prescaler underflows UFL1 is generated (see Figure
internal prescaler is reloaded with the value from the PRH
and PRL registers Each additional underflow of the prescal-
er causes the port pin to toggle and reloads the internal
prescaler
Every second underflow of the prescaler generates the sig-
nal UFL2 (UFL2 occurs at half the frequency of UFL1 or
once per output pulse ) This signal UFL2 decrements the
count register Therefore the count registers are decre-
mented once per output pulse
c
C4TM
Bit 7
The internal prescaler is automatically loaded from PRH
c
to ensure synchronization Each subsequent rising
Number of Pulses
COUNTER4 interrupt enable control bit (1
able IRQ)
underflowed
COUNTER4 test mode control bit (1
path This bit is reserved during normal operation
and must never be set to one )
c
IPND
C4
causes the prescaler to be decremented When
t
w
t
e
c
w
The prescaler is clocked on the rising edge
IEN
C4
The appropriate prescaler value can be
(PRH 256)
w
of 65536 t
RUN
C4
e
CTH 256
a
C3TM
c
PRL
and a minimum t
w
) The high time and low
a
IPND
a
C3
1
CTL
w
e
t
therefore the
c
e
IEN
a
C3
special test
counter 4
1
w
of one
e
RUN
Bit 0
C3
en-