Philips Semiconductors Product data
P87C554
80C51 8-bit microcontroller – 12 clock operation
16K/512 OTP/RAM, 8 channel 10-bit A/D, I
2
C, PWM,
capture/compare, high I/O
2002 Mar 25
17
INTINT
CT0 CT1 CT2 CT3
CTI0
INTCT0I
CTI1
CT1I
CTI2
CT2I
CTI3
CT3I
1/12
Prescaler T2 Counter
8-bit overflow interrupt
16-bit overflow interrupt
External reset
enable
off
f
osc
T2
RT2
T2ER
COMP
CMO (S)
INT
COMP
CM1 (R)
INT
COMP
CM2 (T)
INT
P4.0
P4.1
P4.2
P4.3
P4.4
P4.5
P4.6
P4.7
R
R
R
R
R
R
T
T
S
S
S
S
S
S
TG
TG
STE RTE
I/O port 4
S = set
R = reset
T = toggle
TG = toggle status
INT
TML2 = lower 8 bits
TMH2 = higher 8 bits
T2 SFR address:
SU00757
Figure 13. Block Diagram of Timer 2
Capture Logic: The four 16-bit capture registers that Timer T2 is
connected to are: CT0, CT1, CT2, and CT3. These registers are
loaded with the contents of Timer T2, and an interrupt is requested
upon receipt of the input signals CT0I, CT1I, CT2I, or CT3I. These
input signals are shared with port 1. The four interrupt flags are in
the Timer T2 interrupt register (TM2IR special function register). If
the capture facility is not required, these inputs can be regarded as
additional external interrupt inputs.
Using the capture control register CTCON (see Figure 14), these
inputs may capture on a rising edge, a falling edge, or on either a
rising or falling edge. The inputs are sampled during S1P1 of each
cycle. When a selected edge is detected, the contents of Timer T2
are captured at the end of the cycle.
Measuring Time Intervals Using Capture Registers: When a
recurring external event is represented in the form of rising or falling
edges on one of the four capture pins, the time between two events
can be measured using Timer T2 and a capture register. When an
event occurs, the contents of Timer T2 are copied into the relevant
capture register and an interrupt request is generated. The interrupt
service routine may then compute the interval time if it knows the
previous contents of Timer T2 when the last event occurred. With a
12 MHz oscillator, Timer T2 can be programmed to overflow every
524 ms. When event interval times are shorter than this, computing
the interval time is simple, and the interrupt service routine is short.
For longer interval times, the Timer T2 extension routine may be
used.
Compare Logic: Each time Timer T2 is incremented, the contents
of the three 16-bit compare registers CM0, CM1, and CM2 are
compared with the new counter value of Timer T2. When a match is
found, the corresponding interrupt flag in TM2IR is set at the end of
the following cycle. When a match with CM0 occurs, the controller
sets bits 0-5 of port 4 if the corresponding bits of the set enable
register STE are at logic 1.
Philips Semiconductors Product data
P87C554
80C51 8-bit microcontroller – 12 clock operation
16K/512 OTP/RAM, 8 channel 10-bit A/D, I
2
C, PWM,
capture/compare, high I/O
2002 Mar 25
18
CTP0
BIT SYMBOL CAPTURE/INTERRUPT ON:
CTCON.7 CTN3 Capture Register 3 triggered by a falling edge on CT3I
CTCON.6 CTP3 Capture Register 3 triggered by a rising edge on CT3I
CTCON.5 CTN2 Capture Register 2 triggered by a falling edge on CT2I
CTCON.4 CTP2 Capture Register 2 triggered by a rising edge on CT2I
CTCON.3 CTN1 Capture Register 1 triggered by a falling edge on CT1I
CTCON.2 CTP1 Capture Register 1 triggered by a rising edge on CT1I
CTCON.1 CTN0 Capture Register 0 triggered by a falling edge on CT0I
CTCON.0 CTP0 Capture Register 0 triggered by a rising edge on CT0I
SU01085
CTN1CTP1CTN1CTP2CTN2CTP3CTN3
01234567
(LSB)(MSB)
CTCON (EBH)
Reset Value = 00H
Figure 14. Capture Control Register (CTCON)
When a match with CM1 occurs, the controller resets bits 0-5 of port
4 if the corresponding bits of the reset/toggle enable register RTE
are at logic 1 (see Figure 15 for RTE register function). If RTE is “0”,
then P4.n is not affected by a match between CM1 or CM2 and
Timer 2. When a match with CM2 occurs, the controller “toggles”
bits 6 and 7 of port 4 if the corresponding bits of the RTE are at
logic 1. The port latches of bits 6 and 7 are not toggled.
Two additional flip-flops store the last operation, and it is these
flip-flops that are toggled.
Thus, if the current operation is “set,” the next operation will be
“reset” even if the port latch is reset by software before the “reset”
operation occurs. The first “toggle” after a chip RESET will set the
port latch. The contents of these two flip-flops can be read at STE.6
and STE.7 (corresponding to P4.6 and P4.7, respectively). Bits
STE.6 and STE.7 are read only (see Figure 16 for STE register
function). A logic 1 indicates that the next toggle will set the port
latch; a logic 0 indicates that the next toggle will reset the port latch.
CM0, CM1, and CM2 are reset by the RST signal.
The modified port latch information appears at the port pin during
S5P1 of the cycle following the cycle in which a match occurred. If
the port is modified by software, the outputs change during S1P1 of
the following cycle. Each port 4 bit can be set or reset by software at
any time. A hardware modification resulting from a comparator
match takes precedence over a software modification in the same
cycle. When the comparator results require a “set” and a “reset” at
the same time, the port latch will be reset.
Timer T2 Interrupt Flag Register TM2IR: Eight of the nine Timer
T2 interrupt flags are located in special function register TM2IR (see
Figure 17). The ninth flag is TM2CON.4.
The CT0I and CT1I flags are set during S4 of the cycle in which the
contents of Timer T2 are captured. CT0I is scanned by the interrupt
logic during S2, and CT1I is scanned during S3. CT2I and CT3I are
set during S6 and are scanned during S4 and S5. The associated
interrupt requests are recognized during the following cycle. If these
flags are polled, a transition at CT0I or CT1I will be recognized one
cycle before a transition on CT2I or CT3I since registers are read
during S5. The CMI0, CMI1, and CMI2 flags are set during S6 of the
cycle following a match. CMI0 is scanned by the interrupt logic
during S2; CMI1 and CMI2 are scanned during S3 and S4. A match
will be recognized by the interrupt logic (or by polling the flags) two
cycles after the match takes place.
The 16-bit overflow flag (T2OV) and the byte overflow flag (T2BO)
are set during S6 of the cycle in which the overflow occurs. These
flags are recognized by the interrupt logic during the next cycle.
Special function register IP1 (Figure 17) is used to determine the
Timer T2 interrupt priority. Setting a bit high gives that function a
high priority, and setting a bit low gives the function a low priority.
The functions controlled by the various bits of the IP1 register are
shown in Figure 17.
RP40
BIT SYMBOL FUNCTION
RTE.7 TP47 If “1” then P4.7 toggles on a match between CM1 and Timer T2
RTE.6 TP46 If “1” then P4.6 toggles on a match between CM1 and Timer T2
RTE.5 RP45 If “1” then P4.5 is reset on a match between CM1 and Timer T2
RTE.4 RP44 If “1” then P4.4 is reset on a match between CM1 and Timer T2
RTE.3 RP43 If “1” then P4.3 is reset on a match between CM1 and Timer T2
RTE.2 RP42 If “1” then P4.2 is reset on a match between CM1 and Timer T2
RTE.1 RP41 If “1” then P4.1 is reset on a match between CM1 and Timer T2
RTE.0 RP40 If “1” then P4.0 is reset on a match between CM1 and Timer T2
SU01086
RO41RP42RP43RP44RP45TP46TP47
01234567
(LSB)(MSB)
RTE (EFH)
Reset Value = 00H
Figure 15. Reset/Toggle Enable Register (RTE)
Philips Semiconductors Product data
P87C554
80C51 8-bit microcontroller – 12 clock operation
16K/512 OTP/RAM, 8 channel 10-bit A/D, I
2
C, PWM,
capture/compare, high I/O
2002 Mar 25
19
SP40
BIT SYMBOL FUNCTION
STE.7 TG47 Toggle flip-flops
STE.6 TG46 Toggle flip-flops
STE.5 SP45 If “1” then P4.5 is set on a match between CM0 and Timer T2
STE.4 SP44 If “1” then P4.4 is set on a match between CM0 and Timer T2
STE.3 SP43 If “1” then P4.3 is set on a match between CM0 and Timer T2
STE.2 SP42 If “1” then P4.2 is set on a match between CM0 and Timer T2
STE.1 SP41 If “1” then P4.1 is set on a match between CM0 and Timer T2
STE.0 SP40 If “1” then P4.0 is set on a match between CM0 and Timer T2
SU01087
SP41SP42SP43SP44SP45TG46TG47
01234567
(LSB)(MSB)
STE (EEH)
Reset Value = C0H
Figure 16. Set Enable Register (STE)
CTI0
BIT SYMBOL FUNCTION
TM2IR.7 T2OV Timer T2 16-bit overflow interrupt flag
TM2IR.6 CMI2 CM2 interrupt flag
TM2IR.5 CMI1 CM1 interrupt flag
TM2IR.4 CMI0 CM0 interrupt flag
TM2IR.3 CTI3 CT3 interrupt flag
TM2IR.2 CTI2 CT2 interrupt flag
TM2IR.1 CTI1 CT1 interrupt flag
TM2IR.0 CTI0 CT0 interrupt flag
SU01088
CTI1CTI2CTI3CMI0CMI1CMI2T2OV
01234567
(LSB)(MSB)
TM2IR (C8H)
Interrupt Flag Register (TM2IR)
PCT0
BIT SYMBOL FUNCTION
IP1.7 PT2 Timer T2 overflow interrupt(s) priority level
IP1.6 PCM2 Timer T2 comparator 2 interrupt priority level
IP1.5 PCM1 Timer T2 comparator 1 interrupt priority level
IP1.4 PCM0 Timer T2 comparator 0 interrupt priority level
IP1.3 PCT3 Timer T2 capture register 3 interrupt priority level
IP1.2 PCT2 Timer T2 capture register 2 interrupt priority level
IP1.1 PCT1 Timer T2 capture register 1 interrupt priority level
IP1.0 PCT0 Timer T2 capture register 0 interrupt priority level
PCT1PCT2PCT3PCM0PCM1PCM2PT2
01234567
(LSB)(MSB)
IP1 (F8H)
Timer 2 Interrupt Priority Register (IP1)
Reset Value = 00H
Reset Value = 00H
Figure 17. Interrupt Flag Register (TM2IR) and Timer T2 Interrupt Priority Register (IP1)

P87C554SFAA,512

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
Microcontrollers - MCU 8-bit Microcontrollers - MCU 80C51 16K/512 OTP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet