Philips Semiconductors Preliminary data
P87LPC760
Low power, low price, low pin count (14 pin)
microcontroller with 1 kbyte OTP
2002 Mar 07
28
Mode 0
Putting either Timer into Mode 0 makes it look like an 8048 Timer,
which is an 8-bit Counter with a divide-by-32 prescaler. Figures 24
and 25 show Mode 0 operation.
In this mode, the Timer register is configured as a 13-bit register. As
the count rolls over from all 1s to all 0s, it sets the Timer interrupt
flag TFn. The count input is enabled to Timer 0 when TR0 = 1 and
either GATE = 0 or INT0 = 1. (Setting GATE = 1 allows the Timer to
be controlled by external input INT0, to facilitate pulse width
measurements). TRn is a control bit in the Special Function Register
TCON (Figure 23). The GATE bit is in the TMOD register (TMOD.3).
The 13-bit register consists of all 8 bits of THn and the lower 5 bits
of TLn. The upper 3 bits of TLn are indeterminate and should be
ignored. Setting the run flag (TRn) does not clear the registers.
Mode 0 operation is slightly different for Timer 0 and Timer 1. See
Figures 24 and 25.
BIT SYMBOL FUNCTION
TCON.7 TF1 Timer 1 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when the
interrupt is processed, or by software.
TCON.6 TR1 Timer 1 Run control bit. Set/cleared by software to turn Timer/Counter 1 on/off.
TCON.5 TF0 Timer 0 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when the
processor vectors to the interrupt routine, or by software.
TCON.4 TR0 Timer 0 Run control bit. Set/cleared by software to turn Timer/Counter 0 on/off.
TCON.3, 2 Reserved (must be 0).
TCON.1 IE0 Interrupt 0 Edge flag. Set by hardware when external interrupt 0 edge is detected. Cleared by
hardware when the interrupt is processed, or by software.
TCON.0 IT0 Interrupt 0 Type control bit. Set/cleared by software to specify falling edge/low level triggered
external interrupts.
IT0
SU01543
IE0TR0TF0TR1TF1
01234567
TCON
Reset Value: 00h
Bit Addressable
Address: 88h
Figure 23. Timer/Counter Control Register (TCON)
SU01544
TL0
(5 BITS)
TH0
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
T0 PIN
T0OE
TOGGLE
CONTROL
C/T
= 1
C/T
= 0
T0 PIN
TR0
GATE
INT0
PIN
INTERRUPT
TF0
Figure 24. Timer/Counter 0 in Mode 0 (13-Bit Timer/Counter)
Philips Semiconductors Preliminary data
P87LPC760
Low power, low price, low pin count (14 pin)
microcontroller with 1 kbyte OTP
2002 Mar 07
29
SU01553
TL1
(5 BITS)
TH1
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
CONTROL
TR1
INTERRUPT
TF1
Figure 25. Timer 1 in Mode 0 (13-Bit Timer)
Mode 1
Mode 1 is the same as Mode 0, except that all 16 bits of the timer
register (THn and TLn) are used. (See Figures 26 and 27)
Mode 2
Mode 2 configures the Timer register as an 8-bit Counter (TLn) with
automatic reload, as shown in Figures 28 and 29. Overflow from TLn
not only sets TFn, but also reloads TLn with the contents of THn,
which must be preset by software. The reload leaves THn
unchanged. Mode 2 operation is slightly different for Timer 0 and
Timer 1 (see Figures 28 and 29).
Mode 3
When Timer 1 is in Mode 3 it is stopped. The effect is the same as
setting TR1 = 0.
Timer 0 in Mode 3 establishes TL0 and TH0 as two separate 8-bit
counters. The logic for Mode 3 on Timer 0 is shown in Figure 30.
TL0 uses the Timer 0 control bits: C/T
, GATE, TR0, and TF0 as well
as the INT0
pin. TH0 is locked into a timer function (counting
machine cycles) and takes over the use of TR1 and TF1 from Timer
1. Thus, TH0 now controls the “Timer 1” interrupt.
Mode 3 is provided for applications that require an extra 8-bit timer.
With Timer 0 in Mode 3, an P87LPC760 can look like it has three
Timer/Counters. When Timer 0 is in Mode 3, Timer 1 can be turned
on and off by switching it into and out of its own Mode 3. It can still
be used by the serial port as a baud rate generator, or in any
application not requiring an interrupt.
SU01545
TL0
(8 BITS)
TH0
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
T0 PIN
T0OE
TOGGLE
CONTROL
C/T
= 1
C/T
= 0
T0 PIN
TR0
GATE
INT0
PIN
INTERRUPT
TF0
Figure 26. Timer/Counter 0 in Mode 1 (16-Bit Timer/Counter)
SU01546
TL1
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
CONTROL
TR1
INTERRUPT
TF1
TH1
(8 BITS)
Figure 27. Timer 1 in Mode 1 (16-Bit Timer)
Philips Semiconductors Preliminary data
P87LPC760
Low power, low price, low pin count (14 pin)
microcontroller with 1 kbyte OTP
2002 Mar 07
30
SU01547
TL0
(8 BITS)
TH0
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
T0 PIN
T0OE
TOGGLE
CONTROL
C/T
= 1
C/T
= 0
T0 PIN
TR0
GATE
INT0
PIN
INTERRUPT
TF0
RELOAD
Figure 28. Timer/Counter 0 in Mode 2 (8-Bit Auto-Reload)
SU01548
TL1
(8 BITS)
TH1
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
CONTROL
TR1
INTERRUPT
TF1
RELOAD
Figure 29. Timer 1 in Mode 2 (8-Bit Auto-Reload)
SU01549
TL0
(8 BITS)
OSC/6 OR
OSC/12
OVERFLOW
T0 PIN
T0OE
TOGGLE
CONTROL
C/T
= 1
C/T
= 0
T0 PIN
TR0
GATE
INT0
PIN
INTERRUPT
TF0
TH0
(8 BITS)
OVERFLOW
CONTROL
INTERRUPT
TF1
TR1
OSC/6 OR
OSC/12
Figure 30. Timer/Counter 0 Mode 3 (Two 8-Bit Timer/Counters)

P87LPC760BN,112

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
IC MCU 8BIT 1KB OTP 14DIP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet