Philips Semiconductors Preliminary data
87LPC762
Low power, low price, low pin count (20 pin)
microcontroller with 2 kbyte OTP
2001 Oct 26
31
SU01176
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
T1 PIN
T1OE
TOGGLE
CONTROL
INTERRUPT
TF1
TR1
OSC/6 OR
OSC/12
Figure 27. Timer/Counter 0 Mode 3 (Two 8-Bit Counters)
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 T0OE and
T1OE in the P2M1 register, and apply to Timer 0 and Timer 1
respectively. The port outputs will be a logic 1 prior to the first timer
overflow when this mode is turned on.
UART
The 87LPC762 includes an enhanced 80C51 UART. The baud rate
source for the UART is timer 1 for modes 1 and 3, while the rate is
fixed in modes 0 and 2. Because CPU clocking is different on the
87LPC762 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:
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.
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 Timer 1 overflow rate.
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.
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 Timer 1 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.
Philips Semiconductors Preliminary data
87LPC762
Low power, low price, low pin count (20 pin)
microcontroller with 2 kbyte OTP
2001 Oct 26
32
Serial Port Control Register (SCON)
The serial port control and status register is the Special Function
Register SCON, shown in Figure 28. 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.
BIT SYMBOL FUNCTION
SCON.7 FE Framing Error. This bit is set by the UART receiver when an invalid stop bit is detected. Must be
cleared by software. The SMOD0 bit in the PCON register must be 1 for this bit to be accessible.
See SM0 bit below.
SCON.7 SM0 With SM1, defines the serial port mode. The SMOD0 bit in the PCON register must be 0 for this bit
to be accessible. See FE bit above.
SCON. 6 SM1 With SM0, defines the serial port mode (see table below).
SM0, SM1
UART Mode Baud Rate
0 0 0: shift register CPU clock/6
0 1 1: 8-bit UART Variable (see text)
1 0 2: 9-bit UART CPU clock/32 or CPU clock/16
1 1 3: 9-bit UART Variable (see text)
SCON.5 SM2 Enables the multiprocessor communication feature in Modes 2 and 3. In Mode 2 or 3, if SM2 is set
to 1, then Rl will not be activated if the received 9th data bit (RB8) is 0. In Mode 1, if SM2=1 then RI
will not be activated if a valid stop bit was not received. In Mode 0, SM2 should be 0.
SCON.4 REN Enables serial reception. Set by software to enable reception. Clear by software to disable reception.
SCON.3 TB8 The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software as desired.
SCON.2 RB8 In Modes 2 and 3, is the 9th data bit that was received. In Mode 1, it SM2=0, RB8 is the stop bit that
was received. In Mode 0, RB8 is not used.
SCON.1 TI Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at the beginning
of the stop bit in the other modes, in any serial transmission. Must be cleared by software.
SCON.0 RI Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or halfway through
the stop bit time in the other modes, in any serial reception (except see SM2). Must be cleared by
software.
RI
SU01157
TIRB8TB8RENSM2SM1SM0/FE
01234567
SCON
Reset Value: 00h
Bit Addressable
Address: 98h
Figure 28. Serial Port Control Register (SCON)
Philips Semiconductors Preliminary data
87LPC762
Low power, low price, low pin count (20 pin)
microcontroller with 2 kbyte OTP
2001 Oct 26
33
Baud Rates
The baud rate in Mode 0 is fixed: Mode 0 Baud Rate = CPU clock/6.
The baud rate in Mode 2 depends on the value of bit SMOD1 in
Special Function Register PCON. If SMOD1 = 0 (which is the value
on reset), the baud rate is 1/32 of the CPU clock frequency. If
SMOD1 = 1, the baud rate is 1/16 of the CPU clock frequency.
Mode 2 Baud Rate +
1 ) SMOD1
32
x CPU clock frequency
Using Timer 1 to Generate Baud Rates
When Timer 1 is used as the baud rate generator, the baud rates in
Modes 1 and 3 are determined by the Timer 1 overflow rate and the
value of SMOD1. The Timer 1 interrupt should be disabled in this
application. The Timer itself can be configured for either “timer” or
“counter” operation, and in any of its 3 running modes. In the most
typical applications, it is configured for “timer” operation, in the
auto-reload mode (high nibble of TMOD = 0010b). In that case the
baud rate is given by the formula:
Mode 1, 3 Baud Rate +
CPU clock frequencyń
192(or96ifSMOD1+ 1)
256 * (TH1)
Tables 6 and 7 list various commonly used baud rates and how they
can be obtained using Timer 1 as the baud rate generator.
Table 9. Baud Rates, Timer Values, and CPU Clock Frequencies for SMOD1 = 0
Timer Co nt
Baud Rate
Timer
Co
u
nt
2400 4800 9600 19.2k 38.4k 57.6k
–1 0.4608 0.9216 * 1.8432 * 3.6864 * 7.3728 * 11.0592
–2 0.9216 1.8432 * 3.6864 * 7.3728 * 14.7456
–3 1.3824 2.7648 5.5296 * 11.0592
–4 * 1.8432 * 3.6864 * 7.3728 * 14.7456
–5 2.3040 4.6080 9.2160 * 18.4320
–6 2.7648 5.5296 * 11.0592
–7 3.2256 6.4512 12.9024
–8 * 3.6864 * 7.3728 * 14.7456
–9 4.1472 8.2944 16.5888
–10 4.6080 9.2160 * 18.4320

P87LPC762BN,112

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