P89LPC915/916/917
8-bit microcontrollers with two-clock 80C51 core and 8-bit A/D
Rev. 01 — 15 July 2004User manual
Document information
InfoContent
KeywordsP89LPC915, P89LPC916, P89LPC917
AbstractTechnical information for the P89LPC915, P89LPC916, and P89LPC917
devices.
Philips Semiconductors
Revision history
RevDateDescription
0120040715Initial version (9397 750 13316).
UM10107
P89LPC915/916/917 User manual
Contact information
For additional information, please visit: http://www.semiconductors.philips.com
For sales office addresses, please send an email to: sales.addresses@www.semiconductors.philips.com
The P89LPC915/916/917 are single-chip microcontrollers designed for applications
demanding high-integration, low cost solutions over a wide range of performance
requirements. The P89LPC915/916/917 is based on a high performance processor
architecture that executes instructions in two to four clocks, six times the rate of standard
80C51 devices. Many system-level functions have been incorporated into the
P89LPC915/916/917 in order to reduce component count, board space, and system cost.
I/OPort 0: Port 0 is a 6-bit I/O port with user-configurable outputs. During reset Port 0
latches are configured in the input only mode with the internal pull-up disabled. The
operation of Port0 pins as inputs and outputs depends upon the port configuration
selected. Each port pin is configured independently. Refer to Section 5.1
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:
7I/OP1.2 — Port 1 bit 2. (Open drain when used as an output.)
6I/OP1.3 — Port 1 bit 2. (Open drain when used as an output.)
5I/OP1.4 — Port 1 bit 2.
3IP1.5 — Port 1 bit 5. (Input only.)
V
SS
V
DD
4IGround: 0 V reference.
10IPower Supply: This is the power supply voltage for normal operation as well as Idle
I/O
(P1.2);
I(P1.5)
OTxD — Serial port transmitter data.
IRxD — Serial port receiver dat a .
I/OT0 — Timer/counter 0 external count input, overflow output, or PWM output.
I/OSCL — I
I/OINT0
I/OSDA — I
I/OINT1
IRST
Port 1: Port 1 is a 6-bit I/O port with user-configurable outputs. During reset Port 1
latches are configured in the input only mode with the internal pull-up disabled. The
operation of the inputs and outputs depends upon the port configuration selected.
Refer to Section 5.1
input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below:
2
— External interrupt 0 input.
2
— External interrupt 1input.
— 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.
and Power-down modes.
UM10107
P89LPC915/916/917 User manual
for details. P1.2 is an o pen drai n whe n used as an outpu t. P1. 5 is
I/OPort 0: Port 0 is a 5-bit I/O port with user-configurable outputs. During reset Port 0
latches are configured in the input only mode with the internal pull-up disabled. The
operation of Port0 pins as inputs and outputs depends upon the port configuration
selected. Each port pin is configured independently. Refer to Section 5.1
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:
P2.2 to P2.52, 5, 6, 11I/OPort 2: Port 2 is a 4-bit I/O port having user-configurable output types. During reset
V
SS
V
DD
3, 7, 8, 9, 10I/O
(P1.2);
I(P1.5)
10I/OP1.0 — Port 1 bit 0
OTxD — Serial port transmitter data.
9I/OP1.1 — Port 1 bit 0
IRxD — Serial port receiver dat a .
8I/OP1.2 — Port 1 bit 2. (Open drain when used as an output.)
I/OT0 — Timer/counter 0 external count input, overflow output, or PWM output.
I/OSCL — I
7I/OP1.3 — Port 1 bit 2. (Open drain when used as an output.)
I/OINT0
I/OSDA — I
3IP1.5 — Port 1 bit 5. (Input only.)
IRST
6I/OP2.2 — Port 2 bit 2.
OMOSI — SPI master out slave in. When configured as a master this pin is an output.
5I/OP2.3 — Port 2 bit 3.
IMISO — SPI master in slave out. When configured as a master this pin is an input.
2I/OP2.4 — Port 2 bit 4.
I/OSS
11I/OP2.5 — Port 2 bit 5.
I/OSPICLK — When configured as a master this pin is an output. When configured as a
4IGround: 0 V reference.
12IPower Supply: This is the power supply voltage for normal operation as well as Idle
Port 1: Port 1 is a 5-bit I/O port with user-configurable outputs. During reset Port 1
latches are configured in the input only mode with the internal pull-up disabled. The
operation of the P1. 2 input and output s de pends upon the port c onf iguration selected.
Refer to Section 5.1
input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below:
2
C serial clock input/output.
— External interrupt 0 input.
2
C serial data input/output.
— 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.
Port 1 latches are configured in th e input only mode with the i nternal pull-up disabled.
The operation of the P2 input and outputs depends upon the port configuration
selected. Refer to Section 5.1
All pins have Schmitt triggered inputs.
Port 2 also provides various special functions as described below:
When configured as a slave, this pin is an input.
When configured as a slave, this pin is an output.
— SPI Slave select.
slave, this pin is an input.
and Power-down modes.
for details. P1.2 is an o pen drai n whe n used as an outpu t. P1. 5 is
I/OPort 0: Port 0 is a 7-bit I/O port with user-configurable outputs. During reset Port 0
latches are configured in the input only mode with the internal pull-up 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 Section 5.1
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:
8I/OP1.2 — Port 1 bit 2. (Open drain when used as an output.)
7I/OP1.3 — Port 1 bit 3. (Open drain when used as an output.)
6I/OP1.4 — Port 1 bit 4.
3IP1.5 — Port 1 bit 5. (Input only.)
P2.25I/OPort 2: Port 2.2 is a single-bit I/O port with a user-configurable output. During reset
V
SS
V
DD
4IGround: 0 V reference.
12IPower Supply: This is the power supply v olt age fo r norma l ope ration as w ell as Id le
I/O
(P1.0:4);
I(P1.5)
OTxD — Serial port transmitter data.
IRxD — Serial port receiver data.
I/OT0 — Timer/counter 0 external count input, overflow, or PWM output.
I/OSCL — I
I/OINT0
I/OSDA — I
I/OINT1
IRST
Port 1: Port 1 is a 6-bit I/O port with user-configurable outputs. During reset Port 1
latches are configured in the input only mode with the internal pull-up disabled. The
operation of the outputs depends upon the port configuration selected. Refer to
Section 5.1
input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below:
functioning as a reset input a LOW on thi s pin reset s t he mi crocon trolle r, 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.
the Port 2.2 latch is configured in the input only mode with the internal pull-up
disabled. The operation of the output depends upon the port configuration selected.
Refer to Section 5.1
This pin has a Schmitt triggered i nput.
and Power-down modes.
for details. P1.2 and P1.3 are open drain when used as outputs. P1.5 is
2
C serial clock input/output.
— External interrupt 0 input.
2
C serial data input/output.
— External interrupt 1input.
— External Reset input during power-on or if selected via UCFG1. When
TH1Timer 1 high8DH0000000000
TL0Timer 0 low8AH0000000000
TL1Timer 1 low8BH0000000000
TMODTimer 0 and 1 mode89HT1GATET1C/T
TRIMInternal oscillator trim register96HRCCLK-TRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
WDCONWatchdog control registerA7HPRE2PRE1PRE0--WDRUNWDTOFWDCLK
WDLWatchdog loadC1HFF11111111
WFEED1Watchdog feed 1C2H
WFEED2Watchdog feed 2C3H
[1] All ports are in input only (high impedance) state after power-up.
[2] BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is logic 0. If any are written while BRGEN = 1, the result is unpredictable.
[3] The RSTSRC register reflects the cause of the P89LPC915/916/917 reset. Upon a power-up reset, all reset source flags are cleared except POF and BOF; the power-on reset
[4] After reset, the value is 111001x1, i.e., PRE[2:0] are all logic 1, WDRUN = 1 and WDCLK = 1. WDTOF bit is logic 1 after Watchdog reset and is logic 0 after power-on reset. Other
[5] On power-on reset, the TRIM SFR is initialized with a factory preprogrammed value. Other resets will not cause initialization of the TRIM register.
[6] The only reset source that affects these SFRs is power-on reset
AD1DAT0 A/D_1 data register 0D5H0000000000
AD1DAT1 A/D_1 data register 1D6H0000000000
AD1DAT2 A/D_1 data register 2D7H0000000000
AD1DAT3 A/D_1 data register 3F5H0000000000
AUXR1Auxiliary function registerA2HCLKLPEBRR-ENT0SRST0-DPS00000000x0
B*B registerF0H0000000000
BRGR0
BRGR1
BRGCONBaud rate generator controlBDH------SBRGSBRGEN 00
CMP1Comparator 1 control registerACH--CE1CP1CN1-CO1CMF100
CMP2Comparator 2 control registerADH--CE2CP2CN2OE2CO2CMF200xx000000
DIVMCPU clock divide-by-M
SPStack pointer81H0700000111
SPCTLSPI control registerE2HSSIGSPENDORDMSTRCPOLCPHASPR1SPR00400000100
SPSTATSPI status registerE1HSPIFWCOL------0000xxxxxx
SPDATSPI data registerE3H0000000000
TAMODTimer0 and 1 auxiliary mode8FH-------T0M200xxx0xxx0
TCON*Timer 0 and 1 control88HTF1TR1TF0TR0--IE0IT00000000000
TH0Timer 0 HIGH8CH0000000000
TH1Timer 1 HIGH8DH0000000000
TL0Timer 0 LOW8AH0000000000
TL1Timer 1 LOW8BH0000000000
TMODTimer 0 and 1 mode89HT1GATET1C/T
TRIMInternal oscillator trim register96HRCCLK-TRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
WDCONWatchdog control registerA7HPRE2PRE1PRE0--WDRUNWDTOFWDCLK
WDLWatchdog loadC1HFF11111111
WFEED1Watchdog feed 1C2H
WFEED2Watchdog feed 2C3H
[1] All ports are in input only (high impedance) state after power-up.
[2] BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is logic 0. If any are written while BRGEN = 1, the result is unpredictable.
[3] The RSTSRC register reflects the cause of the P89LPC915/916/917 reset. Upon a power-up reset, all reset source flags are cleared except POF and BOF; the power-on reset
value is xx110000.
[4] After reset, the value is 111001x1, i.e., PRE[2:0] are all logic 1, WDRUN = 1 and WDCLK = 1. WDTOF bit is logic 1 after Watchdog reset and is logic 0 after power-on reset. Other
resets will not affect WDTOF.
[5] On power-on reset, the TRIM SFR is initialized with a factory preprogrammed value. Other resets will not cause initialization of the TRIM register.
[6] The only reset source that affects these SFRs is power-on reset.
P89LPC915/916/917 User manual
UM10107
xxxxxxxxxxxxxxxx xxxxx xxxxxxx xxxxxxxxxxx xxxxxxxx xxxx xxx x x x xxxxxxxx xxxxxxxxxxxxxx xxxxxxxx xxx xxxxxxxxxxxx xxxx xx xx xxxx x
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
AD1DAT0 A/D_1 data register 0D5H0000000000
AD1DAT1 A/D_1 data register 1D6H0000000000
AD1DAT2 A/D_1 data register 2D7H0000000000
AD1DAT3 A/D_1 data register 3F5H0000000000
AUXR1Auxiliary function registerA2HCLKLPEBRRENT1ENT0SRST0-DPS00000000x0
B*B registerF0H0000000000
BRGR0
BRGR1
BRGCONBaud rate generator controlBDH------SBRGSBRGEN 00
CMP1Comparator 1 control registerACH--CE1CP1CN1-CO1CMF100
CMP2Comparator 2 control registerADH--CE2CP2CN2OE2CO2CMF200
DIVMCPU clock divide-by-M
[1] All ports are in input only (high impedance) state after power-up.
[2] BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is logic 0. If any are written while BRGEN = 1, the result is unpredictable.
[3] The RSTSRC register reflects the cause of the P89LPC915/916/917 reset. Upon a power-up reset, all reset source flags are cleared except POF and BOF; the power-on reset
[4] After reset, the value is 111001x1, i.e., PRE[2:0] are all logic 1, WDRUN = 1 and WDCLK = 1. WDTOF bit is logic 1 after Watchdog reset and is logic 0 after power-on reset. Other
[5] On power-on reset, the TRIM SFR is initialized with a factory preprogrammed value. Other resets will not cause initialization of the TRIM register.
[6] The only reset source that affects these SFRs is power-on reset.
The various P89LPC915/916/917 memory spaces are as follows:
DAT A — 128 bytes of internal data memory space (00h:7Fh) accessed via direct or
indirect addressing, using instruction other than MOVX and MOVC. All or part of the Stack
may be in this area.
IDAT A — Indirect Data. 256 bytes of internal data memory space (00h:FFh) accessed via
indirect addressing using instructions other than MOVX and MOVC. All or part of the
Stack may be in this area. This area includes the DATA area and the 128 bytes
immediately above it.
SFR — Special Function Registers. Selected CPU registers and peripheral control and
status registers, accessible only via direct addressing.
CODE — 64 kB of Code memory space, accessed as part of program execution and via
the MOVC instruction. The P89LPC915/916/917 has 2 kB of on-chip Code memory.
Table 8:Data RAM arrangement
TypeData RAMSize (bytes)
DA TADirectly and indirectly addressab le memo ry128
IDATAIndirectly addressable memory256
The P89LPC915/916/917 uses an enhanced 80C51 CPU which runs at six 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.
2.2Clock definit ions
The P89LPC915/916/917 device has several internal clocks as defined below:
OSCCLK — Input to the DIVM clock divider. OSCCLK is selected from one of three clock
sources and can also be optionally divided to a slower frequency (see Figure 11
Section 2.8 “
OSCCLK frequency.
CCLK — CPU clock; output of the DIVM clock divider. There are two CCLK cycles per
machine cycle, and most instructions are executed in one to two machine cycles (two or
four CCLK cycles).
RCCLK — The internal 7.373 MHz RC oscillator output.
PCLK — Clock for the various peripheral devices and is
P89LPC915/916/917 User manual
CPU Clock (CCLK) modification: DIVM register”). Note: f
CCLK
e
.
2
UM10107
and
is defined as the
osc
The P89LPC915/916/917 provides 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, or an external clock source.
2.3Clock output (P89LPC917)
The P89LPC917 supports a user-selectable clock output function on the CLKOUT pin.
This allows external devices to synchronize to the P89LPC917. This output is enabled by
the ENCLK bit in the TRIM register.
The frequency of this clock output is
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.
1
e
that of the CCLK. If the clock output is not needed
2
2.4On-chip RC oscillator option
The P89LPC915/916/917 has a 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, r 1 %. (Note: the initial value is
better than 1 %; please refer to the P89LPC915/916/917 data sheet 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.
Table 9:On-chip RC oscillator trim register (TRIM - address 96h) bit allocation
Bit76543210
SymbolRCCLKENCLKTRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
Reset00Bits 5:0 loaded with factory stored value during reset.
Table 10: On-chip RC oscillator trim register (TRIM - address 96h) bit description
Bit SymbolDescription
0TRIM.0Trim value. Determines the frequency of the internal RC oscillator. During
1TRIM.1
2TRIM.2
3TRIM.3
4TRIM.4
5TRIM.5
6ENCLKwhen = 1,
7RCCLKwhen = 1, selects the RC Oscillator output as the CPU clock (CCLK)
UM10107
P89LPC915/916/917 User manual
reset, these bits are loaded wi th a stored factory calibra tion value. When w riting
to either bit 6 or bit 7 of this register, care should be taken to preserve the
current TRIM value by reading this register, modifying bits 6 or 7 as required,
and writing the result to this register.
CCLK
e
is output on the XTAL2 pin provide d the cryst al osci llator is no t
being used.
2
2.5Watchdog oscillator option
The watchdog has a separate oscillator which has a frequency of 400 kHz. This oscillator
can be used to save power when a high clock frequency is not needed.
2.6External clock input option
In this configuration, the processor clock is derived from an external source driving the
P0.5 pin. The rate may be from 0 Hz up to 12 MHz.