Philips Semiconductors
P87LPC778
CMOS single-chip 8-bit microcontroller
Product data Rev. 01 — 31 March 2004 49 of 79
9397 750 12378
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
2 IT1 Interrupt 1 Type control bit. Set/cleared by software to specify
falling edge/low level triggered external interrupts.
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.
0 IT0 Interrupt 0 Type control bit. Set/cleared by software to specify
falling edge/low level triggered external interrupts.
Table 47: TCON - Timer/counter control register (address 88H) bit description
Bit Symbol Description
Fig 19. Timer/counter 0 or 1 in Mode 0 (13-bit counter).
002aaa637
Osc/6
or Osc/12
Tn pin
TRn
Gate
INTn pin
C/T = 0
C/T = 1
TLn
(5-bits)
THn
(8-bits)
TFn
control
TnOE
Tn pin
toggle
overflow
interrupt
Fig 20. Timer/counter 0 or 1 in Mode 1 (16-bit counter).
002aaa638
Osc/6
or Osc/12
Tn pin
TRn
Gate
INTn pin
C/T = 0
C/T = 1
TLn
(8-bits)
THn
(8-bits)
TFn
control
TnOE
Tn pin
toggle
overflow
interrupt
Fig 21. Timer/counter 0 or 1 in Mode 2 (8-bit auto-reload).
002aaa639
Osc/6
or Osc/12
Tn pin
TRn
Gate
INTn pin
C/T = 0
C/T = 1
TLn
(8-bits)
THn
(8-bits)
TFn
control
Tine
Tn pin
toggle
overflow
interrupt
reload
Philips Semiconductors
P87LPC778
CMOS single-chip 8-bit microcontroller
Product data Rev. 01 — 31 March 2004 50 of 79
9397 750 12378
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
8.14.5 Timer overflow toggle output
Timers 0 and 1 can be configured to automatically toggle a port output whenever a
timer overflow occurs. The same device pins that are used for the T0 and T1 count
inputs are also used for the timer toggle outputs. This function is enabled by control
bits ENT0 and ENT1 in the P2M1 register, and apply to Timer0 and Timer1
respectively. The port outputs will be a logic 1 prior to the first timer overflow when
this mode is turned on.
8.15 UART
The P87LPC778 includes an enhanced 80C51 UART. The baud rate source for the
UART is Timer1 for modes 1 and 3, while the rate is fixed in modes 0 and 2. Because
CPU clocking is different on the P87LPC778 than on the standard 80C51, baud rate
calculation is somewhat different. Enhancements over the standard 80C51 UART
include Framing Error detection and automatic address recognition.
The serial port is full duplex, meaning it can transmit and receive simultaneously. It is
also receive-buffered, meaning it can commence reception of a second byte before a
previously received byte has been read from the SBUF register. However, if the first
byte still hasn’t been read by the time reception of the second byte is complete, the
first byte will be lost. The serial port receive and transmit registers are both accessed
through Special Function Register SBUF. Writing to SBUF loads the transmit register,
and reading SBUF accesses a physically separate receive register.
The serial port can be operated in 4 modes.
Fig 22. Timer/counter 0 Mode 3 (two 8-bit counters).
002aaa640
Osc/6
or Osc/12
Osc/6
or Osc/12
T0 pin
TR0
TR1
Gate
INT0 pin
C/T = 0
C/T = 1
TL0
(8-bits)
TF0
control
T0OE
T0 pin
toggle
overflow
interrupt
TH0
(8-bits)
TF1
control
T1OE
T1 pin
toggle
overflow
interrupt
Philips Semiconductors
P87LPC778
CMOS single-chip 8-bit microcontroller
Product data Rev. 01 — 31 March 2004 51 of 79
9397 750 12378
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
8.15.1 Mode 0
Serial data enters and exits through RxD. TxD outputs the shift clock. 8 bits are
transmitted or received, LSB first. The baud rate is fixed at
1
6
of the CPU clock
frequency.
8.15.2 Mode 1
10 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0),
8 data bits (LSB first), and a stop bit (logical 1). When data is received, the stop bit is
stored in RB8 in Special Function Register SCON. The baud rate is variable and is
determined by the Timer1 overflow rate.
8.15.3 Mode 2
11 bits are transmitted (through TxD) or received (through RxD): start bit (logical 0), 8
data bits (LSB first), a programmable 9th data bit, and a stop bit (logical 1). When
data is transmitted, the 9th data bit (TB8 in SCON) can be assigned the value of 0 or
1. Or, for example, the parity bit (P, in the PSW) could be moved into TB8. When data
is received, the 9th data bit goes into RB8 in Special Function Register SCON, while
the stop bit is ignored. The baud rate is programmable to either
1
16
or
1
32
of the CPU
clock frequency, as determined by the SMOD1 bit in PCON.
8.15.4 Mode 3
11 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0),
8 data bits (LSB first), a programmable 9th data bit, and a stop bit (logical 1). In fact,
Mode 3 is the same as Mode 2 in all respects except baud rate. The baud rate in
Mode 3 is variable and is determined by the Timer1 overflow rate.
In all four modes, transmission is initiated by any instruction that uses SBUF as a
destination register. Reception is initiated in Mode 0 by the condition RI = 0 and
REN = 1. Reception is initiated in the other modes by the incoming start bit if
REN=1.
8.15.5 Serial port control register (SCON)
The serial port control and status register is the Special Function Register SCON,
shown in Tables 48 and 49. This register contains not only the mode selection bits,
but also the 9th data bit for transmit and receive (TB8 and RB8), and the serial port
interrupt bits (TI and RI).
The Framing Error bit (FE) allows detection of missing stop bits in the received data
stream. The FE bit shares the bit position SCON.7 with the SM0 bit. Which bit
appears in SCON at any particular time is determined by the SMOD0 bit in the PCON
register. If SMOD0 = 0, SCON.7 is the SM0 bit. If SMOD0 = 1, SCON.7 is the FE bit.
Once set, the FE bit remains set until it is cleared by software. This allows detection
of framing errors for a group of characters without the need for monitoring it for every
character individually.
Table 48: SCON - Serial port control register (address 98H) bit allocation
Bit addressable; Reset value: 00H
Bit 7 6 5 4 3 2 1 0
Symbol FE/SM0 SM1 SM2 REN TB8 RB8 TI RI

P87LPC778FDH,529

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

Products related to this Datasheet