The P89LPC901/902/903 is a single-chip microcontroller designed for applications demanding high-integration, low cost
solutions over a wide range of performance requirements. The P89LPC901/902/903 is based on a high performance processor
architecture that executes instructions six times the rate of standard 80C51 devices. Many system level functions have been
incorporated into the P89LPC901/902/903 in order to reduce component count, board space, and system cost.
Pin Configurations
8-Pin Packages
P89LPC901
VDD
XTAL1/P3.1
CLKOUT/XTAL2/P3.0
/P1.5
RST
VDD
P0.2/CIN2A/KBI2
P0.0/CMP2/KBI0
/P1.5
RST
1
2
3
4
P89LPC902
1
2
3
4
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P1.2/T0
5
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P0.6/CMP1/KBI6
5
VDD
P0.2/CIN2A/KBI2
P1.1/RxD
/P1.5
RST
P89LPC903
1
2
3
4
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P1.0/TXD
5
2003 Dec 8 7
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Logic Symbols
KBI4
KBI5
CLKOUT
KBI4
KBI5
KBI6
KBI2
KBI0
CIN1A
CMPREF
XTAL2
XTAL1
CIN1A
CMPREF
CMP1
CIN2A
CMP2
PORT0
PORT3
PORT0
VDDV
SS
P89
LPC901
VDDV
SS
P89
LPC902
P89LPC901/902/903
RST
PORT1
PORT1
T0
RST
VDDV
SS
KBI4
KBI5
KBI2
CIN1A
CMPREF
CIN2ARxD
PORT0
P89
LPC903
PORT1
RST
TxD
Product comparison
The following table highlights differences between these three devices.
Part number
P89LPC901YY YYY
P89LPC902YYYY
P89LPC903YYYYY
Ext crystal
pins
X2 clkout T0 PWM output CMP1 input CMP2 input
CMP Ref
Input
CMP1 & CMP2
outputs
UART
TxD RxD
2003 Dec 8 8
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC901
High Performance
Accelerated 2-clock
1KB Code
Flash
Port 3
Configurable I/Os
Port 1
Configurable I/Os
Port 0
Configurable I/Os
80C51 CPU
Internal Bus
P89LPC901/902/903
128 byte
Data RAM
Timer0
Timer1
Real-Time Clock/
System Timer
Crystal or
Resonator
Keypad
Interrupt
Watchdog Timer
and Oscillator
Programmable
Oscillator Divider
Configurable
Oscillator
CPU
Clock
On-Chip
RC
Oscillator
Analog
Comparator
Power Monitor
(Power-On Reset,
Brownout Reset)
2003 Dec 8 9
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC902
Accelerated 2-clock
1KB Code
Flash
Port 1
Input
Port 0
Configurable I/Os
High Performance
80C51 CPU
Internal Bus
Real-Time Clock/
System Timer
P89LPC901/902/903
128 byte
Data RAM
Timer0
Timer1
Keypad
Interrupt
Watchdog Timer
and Oscillator
Programmable
Oscillator Divider
On-Chip
RC
Oscillator
Analog
Comparators
CPU
Clock
Power Monitor
(Power-On Reset,
Brownout Reset)
2003 Dec 8 10
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC903
High Performance
Accelerated 2-clock
1KB Code
Flash
Port 1
Input
Port 0
Configurable I/Os
Keypad
Interrupt
Watchdog Timer
and Oscillator
P89LPC901/902/903
80C51 CPU
128 byte
Data RAM
Internal Bus
UART
Timer0
Timer1
Real-Time Clock/
System Timer
Analog
Comparators
Programmable
Oscillator Divider
On-Chip
RC
Oscillator
2003 Dec 8 11
CPU
Clock
Power Monitor
(Power-On Reset,
Brownout Reset)
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
PIN DESCRIPTIONS - P89LPC901
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.66, 7I/OPort 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet for details.
The Keypad Interrupt feature operates with port 0 pins.
All pins have Schmitt triggered inputs.
Port 0 also provides various special functions as described below.
P1.0 - P1.54,5Port 1: Port 1 is an I/O port with a user-configurable output types.
During reset Port 1 latches are configured in the input only
mode with the internal pull-up disabled. The operation of the
configurable port 1 pins as inputs and outputs depends
upon the port configuration selected. Each of the
configurable port pins are programmed independently.
Refer to the section on I/O port configuration and the DC
Electrical Characteristics in the Data Sheet for details. P1.5
is input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below.
5I/OP1.2Port 1 bit 2.
I/OT0Timer/counter 0 external count input or overflow output.
4IP1.5Port 1 bit 5. (Input only)
IRST
P3.0 - P3.12, 3I/OPort 3 Port 3 is an I/O port with a user-configurable output types.
All pins have Schmitt triggered inputs.
Port 3 also provides various special functions as described below:
3I/OP3.0Port 3 bit 0.
External Reset input during power-on or if selected via
UCFG1. When functioning as a reset input a low on this pin
resets the microcontroller, causing I/O ports and peripherals
to take on their default states, and the processor begins
execution at address 0. Also used during a power-on
sequence to force In-Circuit Programming mode.
During reset Port 3 latches are configured in the input only
mode with the internal pullup disabled. The operation of
port 3 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet for details.
2003 Dec 8 12
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
OXTAL2 Output from the oscillator amplifier (when a crystal oscillator
option is selected via the FLASH configuration).
OCLKOUTCPU clock divided by 2 when enabled via SFR bit (ENCLK -
TRIM.6). It can be used if the CPU clock is the internal RC
oscillator, watchdog oscillator or external clock input, except
when XTAL1/XTAL2 are used to generate clock source for
the Real-Time clock/system timer.
2I/OP3.1Port 3 bit 1.
IXTAL1 Input to the oscillator circuit and internal clock generator
circuits (when selected via the FLASH configuration). It can
be a port pin if internal RC oscillator or watchdog oscillator
is used as the CPU clock source, AND if XTAL1/XTAL2 are
not used to generate the clock for the Real-Time clock/
system timer.
V
SS
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
P89LPC901/902/903
2003 Dec 8 13
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
PIN DESCRIPTIONS - P89LPC902
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.6 2,3,5,6,7I/OPort 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port configuration
and the DC Electrical Characteristics for details.
The Keypad Interrupt feature operates with port 0 pins.
All pins have Schmitt triggered inputs.
Port 0 also provides various special functions as described below.
P1.54IPort 1: Port 1 is a single-bit input-only port. I/O port without a pull-up.
This pin has a Schmitt trigger.
Port 1 also provides the special function described below.
4IP1.5Port 1 bit 5. (Input only)
IRST
V
SS
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
External Reset input during power-on or if selected via
UCFG1. When functioning as a reset input a low on this pin
resets the microcontroller, causing I/O ports and peripherals
to take on their default states, and the processor begins
execution at address 0. Also used during a power-on
sequence to force In-System Programming mode.
2003 Dec 8 14
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
PIN DESCRIPTIONS - P89LPC903
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.62,6,7I/OPort 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet for details.
The Keypad Interrupt feature operates with port 0 pins.
All pins have Schmitt triggered inputs.
Port 0 also provides various special functions as described below.
P1.0 - P1.53,4,5Port 1: Port 1 is an I/O port with a user-configurable output types.
During reset Port 1 latches are configured in the input only
mode with the internal pull-up disabled. The operation of the
configurable port 1 pins as inputs and outputs depends
upon the port configuration selected. Each of the
configurable port pins are programmed independently.
Refer to the section on I/O port configuration and the DC
Electrical Characteristics in the Data Sheet for details. P1.5
is input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below.
5I/OP1.0Port 1 bit 0.
OTxDSerial port transmitter data.
3I/OP1.1Port 1 bit 1.
IRxDSerial port receiver data.
4IP1.5Port 1 bit 5. (Input only)
IRST
V
SS
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
External Reset input during power-on or if selected via
UCFG1. When functioning as a reset input a low on this pin
resets the microcontroller, causing I/O ports and peripherals
to take on their default states, and the processor begins
execution at address 0. Also used during a power-on
sequence to force In-Circuit Programming mode.
2003 Dec 8 15
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
SPECIAL FUNCTION REGISTERS
Note: Special Function Registers (SFRs) accesses are restricted in the following ways:
1. User must NOT attempt to access any SFR locations not defined.
2. Accesses to any defined SFR locations must be strictly for the functions for the SFRs.
3. SFR bits labeled ’-’, ’0’ or ’1’ can ONLY be written and read as follows:
- ’-’ Unless otherwise specified, MUST be written with ’0’, but can return any value when read (even if it was written with ’0’).
It is a reserved bit and may be used in future derivatives.
- ’0’ MUST be written with ’0’, and will return a ’0’ when read.
- ’1’ MUST be written with ’1’, and will return a ’1’ when read.
Special Function Registers Table - P89LPC901
NameDescription
ACC*AccumulatorE0H00H 00000000
AUXR1#Auxiliary Function RegisterA2HCLKLP--ENT0SRST0-DPS00H
SFR
Address
MSB
E7E6E5E4E3E2E1E0
Bit Functions and AddressesReset Value
LSB
HexBinary
1
000000x0
F7F6F5F4F3F2F1F0
B*B RegisterF0H00H 00000000
1
CMP1#Comparator 1 Control RegisterACH--CE1-CN1-CO1CMF100H
SADDR# Serial Port Address RegisterA9H00H 00000000
SADEN# Serial Port Address EnableB9H00H 00000000
SBUFSerial Port Data Buffer Register99HxxHxxxxxxxx
9F9E9D9C9B9A9998
SCON*Serial Port Control98HSM0/FESM1SM2RENTB8RB8TIRI00H 00000000
SSTAT#Serial Port Extended Status Register BAHDBMOD INTLOCIDIS DBISELFEBROESTINT00H 00000000
00H
1,5
5
5
00000000
011xxx00
00000000
00000000
SPStack Pointer81H07H 00000111
8F8E8D8C8B8A8988
TCON*Timer 0 and 1 Control88HTF1TR1TF0TR0----00H00000000
2003 Dec 8 23
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
NameDescription
TH0Timer 0 High8CH00H 00000000
TH1Timer 1 High8DH00H 00000000
TL0Timer 0 Low8AH00H 00000000
TL1Timer 1 Low8BH00H 00000000
TMODTimer 0 and 1 Mode89H--T1M1T1M0--T0M1T0M000H 00000000
TRIM#Internal Oscillator Trim Register96H--TRIM.5 TRIM.4 TRIM.3 TRIM.2 TRIM.1 TRIM.0Notes 4,5
WDCON# Watchdog Control RegisterA7HPRE2PRE1PRE0--WDRUN WDTOF WDCLKNotes 3,5
WDL#Watchdog LoadC1HFFH 11111111
WFEED1# Watchdog Feed 1C2H
WFEED2# Watchdog Feed 2C3H
SFR
Address
MSB
Bit Functions and AddressesReset Value
P89LPC901/902/903
LSB
HexBinary
Notes:
* SFRs are bit addressable.
# SFRs are modified from or added to the 80C51 SFRs.
- Reserved bits, must be written with 0’s.
§ BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is ’0’. If any of them is written if BRGEN = 1, result is
unpredictable.
Unimplemented bits in SFRs (labeled ’-’ ) are X (unknown) at all times. Unless otherwise specified, ones should not be written to
these bits since they may be used for other purposes in future derivatives. The reset values shown for these bits are ’0’s
although they are unknown when read.
1. All ports are in input only (high impendance) state after power-up.
2. The RSTSRC register reflects the cause of the P89LPC901/902/903 reset. Upon a power-up reset, all reset source flags are
cleared except POF and BOF - the power-on reset value is xx110000.
3. After reset, the value is 111001x1, i.e., PRE2-PRE0 are all 1, WDRUN=1 and WDCLK=1. WDTOF bit is 1 after watchdog
reset and is 0 after power-on reset. Other resets will not affect WDTOF.
4. On power-on reset, the TRIM SFR is initialized with a factory preprogrammed value. Other resets will not cause initialization
of the TRIM register.
5. The only reset source that affects these SFRs is power-on reset.
2003 Dec 8 24
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Memory Organization
The P89LPC901/902/903 memory map is shown in Figure 1-1.
03FFh
Sector 3
0300h
02FFh
Sector 2
0200h
01FFh
Sector 1
0100h
00FFh
Sector 0
0000h
1 KB Flash Code
Memory Space
Special Function
Registers
(directly addressable)
DATA
128 Bytes On-Chip
Data Memory (stack,
direct and indir. addr.)
4 Reg. Banks R0-R7
Data Memory
(DATA, IDATA)
P89LPC901/902/903
FFh
80h
7Fh
00h
Figure 1-1: P89LPC901/902/903 Memory Map
The various P89LPC901/902/903 memory spaces are as follows:
DATA128 bytes of internal data memory space (00h..7Fh) accessed via direct or indirect addressing, using instructions
other than MOVX and MOVC.
SFRSpecial Function Registers. Selected CPU registers and peripheral control and status registers, accessible only via
direct addressing.
CODE1KB of Code memory accessed as part of program execution and via the MOVC instruction.
2003 Dec 8 25
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
2003 Dec 8 26
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC901/902/903
2. CLOCKS
Enhanced CPU
The P89LPC901/902/903 uses an enhanced 80C51 CPU which runs at 6 times the speed of standard 80C51 devices. A machine
cycle consists of two CPU clock cycles, and most instructions execute in one or two machine cycles.
Clock Definitions
The P89LPC901/902/903 device has several internal clocks as defined below:
• OSCCLK - Input to the DIVM clock divider. OSCCLK is selected from one of the clock sources (see Figure 2-3,Figure 2-
4,Figure 2-5) and can also be optionally divided to a slower frequency (see section "CPU Clock (CCLK) Modification: DIVM
Register"). Note: f
• XCLK - Output of the crystal oscillator (P89LPC901)
• CCLK - CPU clock.
• PCLK - Clock for the various peripheral devices and is CCLK/2
CPU Clock (OSCCLK)
is defined as the OSCCLK frequency.
OSC
The P89LPC901 provides several user-selectable oscillator options. This allows optimization for a range of needs from high
precision to lowest possible cost. These options are configured when the FLASH is programmed and include an on-chip
watchdog oscillator, an on-chip RC oscillator, an oscillator using an external crystal, or an external clock source. The crystal
oscillator can be optimized for low, medium, or high frequency crystals covering a range from 20 kHz to 12 MHz.
The P89LPC902 and P89LPC903 devices allow the user to select between an on-chip watchdog oscillator and an on-chip RC
oscillator as the CPU clock source.
Low Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 20 kHz to 100 kHz. Ceramic resonators are also supported in this
configuration.
Medium Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 100 kHz to 4 MHz. Ceramic resonators are also supported in this
configuration.
High Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 4MHz to 12 MHz. Ceramic resonators are also supported in this
configuration. If CCLK is 8MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to ’1’ to reduce power consumption. On
reset, CLKLP is ’0’ allowing highest performance access. This bit can then be set in software if CCLK is running at 8MHz or
slower.
2003 Dec 8 27
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
Quartz crystal or
ceramic resonator
The oscillator must be configured in
one of the following modes:
- Low Frequency Crystal
- Medium Frequency Crystal
- High Frequency Crystal
*
* A series resistor may be required to limit
crystal drive levels. This is especially
important for low frequency crystals.
Figure 2-1: Using the Crystal Oscillator - P89LPC901
P89LPC901/902/903
P89LPC901
XTAL1
XTAL2
Oscillator Option Selection- P89LPC901
The oscillator option is selectable either by the FOSC2:0 bits in UCFG1 or by the RTCS1:0 bits in RTCCON. If the FOSC2:0 bits
select an OSCCLK source of either the internal RC oscillator or the WDT oscillator, then the RTCS1:0 bits will select the oscillator
option for the crystal oscillator. Otherwise, the crystal oscillator option is selected by FOSC2:0. See Table 6-1 and Table 6-2.
Clock Output - P89LPC901
The P89LPC901 supports a user selectable clock output function on the XTAL2 / CLKOUT pin when no crystal oscillator is being
used. This condition occurs if another clock source has been selected (on-chip RC oscillator, watchdog oscillator, external clock
input on X1) and if the Real-Time clock is not using the crystal oscillator as its clock source. This allows external devices to
synchronize to the P89LPC901. This output is enabled by the ENCLK bit in the TRIM register
The frequency of this clock output is 1/2 that of the CCLK. If the clock output is not needed in Idle mode, it may be turned off prior
to entering Idle, saving additional power. Note: on reset, the TRIM SFR is initialized with a factory preprogrammed value.
Therefore when setting or clearing the ENCLK bit, the user should retain the contents of bits 5:0 of the TRIM register. This can
be done by reading the contents of the TRIM register (into the ACC for example), modifying bit 6, and writing this result back into
the TRIM register. Alternatively, the "ANL direct" or "ORL direct" instructions can be used to clear or set bit 6 of the TRIM register.
On-Chip RC oscillator Option
The P89LPC901/902/903 has a 6-bit field within the TRIM register that can be used to tune the frequency of the RC oscillator.
During reset, the TRIM value is initialized to a factory pre-programmed value to adjust the oscillator frequency to 7.373 MHz,
±1%. (Note: the initial value is better than 1%; please refer to the datasheet for behavior over temperature). End user applications
can write to the TRIM register to adjust the on-chip RC oscillator to other frequencies. Increasing the TRIM value will decrease
the oscillator frequency.
2003 Dec 8 28
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
If CCLK is 8MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to ’1’ to reduce power consumption. On reset, CLKLP is
’0’ allowing highest performance access. This bit can then be set in software if CCLK is running at 8MHz or slower.
TRIM
Address: 96h
Not bit addressable
Reset Source(s): Power-up only
Reset Value: On power-up reset, ENCLK = 0, and TRIM.5-0 are loaded with the factory programmed value.
BITSYMBOLFUNCTION
TRIM.7-Reserved.
TRIM.6ENCLKWhen ENCLK =1, CCLK/ 2 is output on the XTAL2 pin (P3.0) provided that the crystal
TRIM.5-0Trim value.
Note: on reset, the TRIM SFR is initialized with a factory preprogrammed value. When setting or clearing either the ENCLK
or RCCLK bits, the user should retain the contents of bits 5:0 of the TRIM register. This can be done by reading the contents
of the TRIM register (into the ACC for example), modifying bits 6 or 7, and writing this result back into the TRIM register.
Alternatively, the "ANL direct" or "ORL direct" instructions can be used to clear or set bit 6 or 7of the TRIM register.
76543210
-ENCLKTRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
oscillator is not being used. When ENCLK=0, no clock output is enabled.(P89LPC901).
Figure 2-2: On-Chip RC Oscillator TRIM Register
P89LPC901/902/903
Watchdog Oscillator Option
The watchdog has a separate oscillator which has a nominal frequency of 400KHz. This oscillator can be used to save power
when a high clock frequency is not needed.
External Clock Input Option - P89LPC901
In this configuration, the processor clock is derived from an external source driving the XTAL1 / P3.1 pin. The rate may be from
0 Hz up to 12 MHz. The XTAL2 / P3.0 pin may be used as a standard port pin or a clock output.
2003 Dec 8 29
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
.
XTAL1
XTAL2
RC Oscillator
(7.3728MHz)
Watchdog
Oscillator
(400KHz)
High freq.
Med freq.
Low freq.
FOSC2:0
OSC
CLK
Oscillator
Clock
DIVM
CPU
Clock
P89LPC901/902/903
RTCS1:0
RTC
CCLK
CPU
/2
PCLK
WDT
Timer 0 & 1
Figure 2-3: Block Diagram of Oscillator Control - P89LPC901
2003 Dec 8 30
Loading...
+ 84 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.