The P89LPC920/921/922 is a single-chip microcontroller designed for applications demanding high-integration, low cost
solutions over a wide range of performance requirements. The P89LPC920/921/922 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 P89LPC920/921/922 in order to reduce component count, board space, and system
cost.
Pin configuration
20-Pin TSSOP, DIP Package
P0.1/CIN2B/KBI1KBI0/CMP2/P0.0
20
P0.2/CIN2A/KBI2
19
P0.3/CIN1B/KBI3
18
P0.4/CIN1A/KBI4
17
P0.5/CMPREF/KBI5
16
VDD
15
P0.6/CMP1/KBI6
14
P0.7/T1/KBI7
13
P1.0/TXD
12
P1.1/RXD
11
P1.7
P1.6
/P1.5
RST
VSS
XTAL1/P3.1
CLKOUT/XTAL2/P3.0
INT1
/P1.4
SDA/INT0
/P1.3
SCL/T0/P1.2
1
2
3
4
5
6
7
8
9
10
Logic symbol
KBI0
KBI1
KBI2
KBI3
KBI4
KBI5
KBI6
KBI7
CLKOUT
CMP2
CIN2B
CIN2A
CIN1B
CIN1A
CMPREF
CMP1
T1
XTAL2
XTAL1
PORT0PORT3
VDDV
SS
P89
LPC920
/921/
922
PORT1
TxD
RxD
T0
INT0
INT1
RST
SCL
SDA
2003 Nov 6 9
Philips Semiconductors
User’s Manual - Preliminary -
General Description
Block diagram
2KB/ 4KB/ 8KB
Code Flash
Port 3
Configurable I/Os
Port 1
Configurable I/Os
P89LPC920/921/922
High Performance
LPC920/921/922 CPU
256 Byte
Data RAM
Internal Bus
UART
Real-Time Clock/
System Timer
Crystal or
Resonator
Port 0
Configurable I/Os
Keypad
Interrupt
Watchdog Timer
and Oscillator
Programmable
Oscillator Divider
Configurable
Oscillator
CPU
Clock
On-Chip
RC
Oscillator
I2C
Timer0
Timer1
Analog
Comparators
Power Monitor
(Power-On Reset,
Brownout Reset)
2003 Nov 6 10
Philips Semiconductors
User’s Manual - Preliminary -
General Description
Pin Descriptions
MnemonicPin no. Type Name and function
P0.0 - P0.7 1, 20, 19,
18, 17,
16, 14,
13
1I/OP0.0Port 0 bit 0.
20I/OP0.1Port 0 bit 1.
19I/OP0.2Port 0 bit 2.
18I/OP0.3Port 0 bit 3.
17I/OP0.4Port 0 bit 4.
16I/OP0.5Port 0 bit 5.
14I/OP0.6Port 0 bit 6.
13I/OP0.7Port 0 bit 7.
I/OPort 0: Port 0 is an 8-bit I/O port with a user-configurable output type. 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.
OCMP2Comparator 2 output.
IKBI0Keyboard Input 0.
ICIN2B Comparator 2 positive input B.
IKBI1Keyboard Input 1.
ICIN2A Comparator 2 positive input A.
IKBI2Keyboard Input 2.
ICIN1B Comparator 1 positive input B.
IKBI3Keyboard Input 3.
ICIN1A Comparator 1 positive input A.
IKBI4Keyboard Input 4.
I/OT1Timer/counter 1 external count input or overflow output.
IKBI7Keyboard Input 7.
P89LPC920/921/922
2003 Nov 6 11
Philips Semiconductors
User’s Manual - Preliminary -
General Description
MnemonicPin no. Type Name and function
P1.0 - P1.712, 11,
10, 9, 8,
4, 3, 2
12I/OP1.0Port 1 bit 0.
11I/OP1.1Port 1 bit 1.
10I/OP1.2Port 1 bit 2. (Open-drain when used as outputs)
9I/OP1.3Port 1 bit 3. (Open-drain when used as outputs)
8I/OP1.4Port 1 bit 4.
4IP1.5Port 1 bit 5. (Input only)
3I/OP1.6Port 1 bit 6.
2I/OP1.7Port 1 bit 7.
P3.0 - P3.17, 6I/OPort 3: Port 3 is an 2-bit I/O port with a user-configurable output type. During reset
7I/OP3.0Port 3 bit 0.
I/O
Port 1: Port 1 is an 8-bit I/O port with a user-configurable output type, except for
(for
three pins as noted below. During reset Port 1 latches are configured in the input
P1.0-
only mode with the internal pullup disabled. The operation of the configurable port 1
P1.4,
pins as inputs and outputs depends upon the port configuration selected. Each of
P1.6-
the configurable port pins are programmed independently. Refer to the section on
P1.7),
I/O port configuration and the DC Electrical Characteristics for details. P1.2 - P1.3
I (for
are open drain when used as outputs. P1.5 is input only.
P1.5)
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below.
OTxDTransmitter output for the serial port.
IRxDReceiver input for the serial port.
I/OT0Timer/counter 0 external count input or overflow output. (Open-drain
when used as outputs)
2
I/OSCLI
IINT0
I/OSDAI2C serial data input/output.
IINT1
IRST
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 for details.
All pins have Schmitt triggered inputs.
Port 3 also provides various special functions as described below:
OXTAL2 Output from the oscillator amplifier (when a crystal oscillator option is
OCLKOUTCPU clock divided by 2 when enabled via SFR bit (ENCLK - TRIM.6).
C serial clock input/output.
External interrupt 0 input.
External interrupt 1 input.
External Reset input (if selected via FLASH configuration). 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.
selected via the FLASH configuration).
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.
P89LPC920/921/922
2003 Nov 6 12
Philips Semiconductors
User’s Manual - Preliminary -
General Description
MnemonicPin no. Type Name and function
6I/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
5IGround: 0V reference.
15IPower Supply: This is the power supply voltage for normal operation as well as
Idle and Power Down modes.
P89LPC920/921/922
2003 Nov 6 13
Philips Semiconductors
User’s Manual - Preliminary -
General Description
P89LPC920/921/922
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
NameDescription
ACC*AccumulatorE0H00H 00000000
AUXR1#Auxiliary Function RegisterA2HCLKLPEBRRENT1ENT0SRST0-DPS00H
WDCON# Watchdog Control RegisterA7HPRE2PRE1PRE0--WDRUN WDTOF WDCLKNotes 3,5
WDL#Watchdog LoadC1HFFH 11111111
WFEED1# Watchdog Feed 1C2H
WFEED2# Watchdog Feed 2C3H
2003 Nov 6 16
Philips Semiconductors
User’s Manual - Preliminary -
General Description
P89LPC920/921/922
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 LPC920/921/922 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 Nov 6 17
Philips Semiconductors
User’s Manual - Preliminary -
General Description
Memory organization
The P89LPC920/921/922 memory map is shown in Figure 1-1.
FF00h
FFEFh
1FFFh
1E00h
1C00h
1BFFh
1800h
17FFh
1400h
13FFh
1000h
0FFFh
0C00h
0BFFh
0800h
07FFh
0400h
03FFh
0000h
IAP entry-points
ISP CODE (512B)*
Sector 7
Sector 6
Sector 5
Sector 4
Sector 3
Sector 2
Sector 1
Sector 0
Read- protected
IAP calls only
IAP routines
entry points for:
- 51 ASM. code
C code
-
ISP
serial loader
-
UART (auto-baud)
-I2C, SPI etc. *
Flexible choices:
- as supplied (UART)
- Phil ips libraries
-user-defined
Note: ISP code is located at the end of Sector
1 on the LPC920, at the end of Sector 4 on the
LPC92 1, AND AT THE END OF Sector 7 on
the LPC922.
P89LPC920/921/922
FFEFh
FF1Fh
FF00h
1FFFh
1E00h
Special Function
Regi sters
(directly addressable)
entry points
I DATA (incl. DATA)
128 Bytes On-Chip
Data Memory (stack
and indirect addr. )
DATA
128 Bytes On-Chip
Data Memory (stack,
direct and indir. addr.)
4 Reg. Banks R0-R7
Data Memory
(DATA, IDATA)
*
Figure 1-1: P89LPC920/921/922 memory map
The various P89LPC920/921/922 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. All or part of the Stack may be in this area.
IDATAIndirect 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.
SFRSpecial Function Registers. Selected CPU registers and peripheral control and status registers, accessible only via
direct addressing.
CODE64 KB of Code memory space, accessed as part of program execution and via the MOVC instruction. The
P89LPC920/921/922 has 2 KB/ 4 KB/ 8 KB of on-chip Code memory.).
2003 Nov 6 18
Philips Semiconductors
User’s Manual - Preliminary -
General Description
P89LPC920/921/922
DATA RAM ARRANGEMENT
The 256 bytes of on-chip RAM is organized as follows:
TypeData RAMSize (Bytes)
DATAMemory that can be addressed directly and indirectly128
IDATAMemory that can be addressed indirectly (includes DATA)256
Table 1-1: On-chip data memory usage.
2003 Nov 6 19
Philips Semiconductors
User’s Manual - Preliminary -
General Description
P89LPC920/921/922
2003 Nov 6 20
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC920/921/922
2. CLOCKS
Enhanced CPU
The P89LPC920/921/922 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.
Clocks
Clock definitions
The P89LPC920/921/922 device has several internal clocks as defined below:
• OSCCLK - Input to the DIVM clock divider. OSCCLK is selected from one of four clock sources (see Figure 2-3) and can also
be optionally divided to a slower frequency (see section "CPU Clock (CCLK) modification: DIVM register").
Note: f
• 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 CCLK/2.
is defined as the OSCCLK frequency.
OSC
Oscillator clock (OSCCLK)
The P89LPC920/921/922 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.
Low speed oscillator option
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
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
This option supports an external crystal in the range of 4 MHz to 12 MHz. Ceramic resonators are also supported in this
configuration.
Clock output
The P89LPC920/921/922 supports a user-selectable clock output function on the XTAL2 / CLKOUT pin when the crystal
oscillator is not being used. This condition occurs if a different 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 P89LPC920/921/922. 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.
2003 Nov 6 21
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC920/921/922
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.
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 (see
text).
Figure 2-1: Using the crystal oscillator
On-chip RC oscillator option
P89LPC920/921/922
XTAL1
XTAL2
The P89LPC920/921/922 has a 6-bit 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.
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 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.
76543210
-ENCLKTRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
oscillator is not being used. When ENCLK=0, no clock output is enabled.
Figure 2-2: On-chip RC oscillator TRIM register
Watchdog 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.
2003 Nov 6 22
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC920/921/922
External clock input option
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.
RTCS1:0
XTAL1
XTAL2
RC Oscillator
(7.3728MHz)
Watchdog
Oscillator
High freq.
Med freq.
Low freq.
FOSC2:0
OSC
CLK
DIVM
CPU
Clock
CCLK
RTC
CPU
/2
WDT
PCLK
(400KHz)
Baud Rate
Generator
UART
Figure 2-3: Block diagram of oscillator control
Timer 0 & 1
Peripheral Clock
I2C
Oscillator Clock (OSCCLK) wakeup delay
The P89LPC920/921/922 has an internal wakeup timer that delays the clock until it stabilizes depending to the clock source used.
If the clock source is any of the three crystal selections, the delay is 992 OSCCLK cycles plus 60-100µs. If the clock source is
either the internal RC oscillator or the Watchdog oscillator, the delay is 224 OSCCLK cycles plus 60-100µs.
CPU Clock (CCLK) modification: DIVM register
The OSCCLK frequency can be divided down, by an integer, up to 510 times by configuring a dividing register, DIVM, to provide
CCLK. This produces the CCLK frequency using the following formula:
CCLK frequency = f
Where: f
Since N ranges from 0 to 255, the CCLK frequency can be in the range of f
This feature makes it possible to temporarily run the CPU at a lower rate, reducing power consumption. By dividing the clock, the
CPU can retain the ability to respond to events other than those that can cause interrupts (i.e. events that allow exiting the Idle
mode) by executing its normal program at a lower rate. This can often result in lower power consumption than in Idle mode. This
is the frequency of OSCCLK
OSC
N is the value of DIVM.
OSC
/ (2N)
OSC
to f
/510. (for N =0, CCLK = f
OSC
OSC
) .
2003 Nov 6 23
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC920/921/922
can allow bypassing the oscillator start-up time in cases where Power down mode would otherwise be used. The value of DIVM
may be changed by the program at any time without interrupting code execution.
Low power select
The P89LPC920/921/922 is designed to run at 12 MHz (CCLK) maximum. However, if CCLK is 8 MHz or slower, the CLKLP
SFR bit (AUXR1.7) can be set to a ‘1’ to lower the power consumption further. On any reset, CLKLP is ‘0’ allowing highest
performance. This bit can then be set in software if CCLK is running at 8 MHz or slower.
2003 Nov 6 24
Philips Semiconductors
User’s Manual - Preliminary -
INTERRUPTS
P89LPC920/921/922
3. INTERRUPTS
The P89LPC920/921/922 uses a four priority level interrupt structure. This allows great flexibility in controlling the handling of the
P89LPC920/921/922’s 12 interrupt sources.
Each interrupt source can be individually enabled or disabled by setting or clearing a bit in the interrupt enable registers IEN0 or
IEN1. The IEN0 register also contains a global enable bit, EA, which enables all interrupts.
Each interrupt source can be individually programmed to one of four priority levels by setting or clearing bits in the interrupt priority
registers IP0, IP0H, IP1, and IP1H. An interrupt service routine in progress can be interrupted by a higher priority interrupt, but
not by another interrupt of the same or lower priority. The highest priority interrupt service cannot be interrupted by any other
interrupt source. If two requests of different priority levels are received simultaneously, the request of higher priority level is
serviced.
If requests of the same priority level are pending at the start of an instruction cycle, an internal polling sequence determines which
request is serviced. This is called the arbitration ranking. Note that the arbitration ranking is only used for pending requests of
the same priority level.
Table summarizes the interrupt sources, flag bits, vector addresses, enable bits, priority bits, arbitration ranking, and whether
each interrupt may wake up the CPU from a Power down mode.
Interrupt priority structure
There are four SFRs associated with the four interrupt levels: IP0, IP0H, IP1, IP1H. Every interrupt has two bits in IPx and IPxH
(x = 0,1) and can therefore be assigned to one of four levels, as shown in Table .
1. SSTAT.5 = 0 selects combined Serial Port (UART) Tx and Rx interrupt; SSTAT.5 = 1 selects Serial Port Rx interrupt only
(Tx interrupt will be different, see Note 3 below).
2. This interrupt is used as Serial Port (UART) Tx interrupt if and only if SSTAT.5 = 1, and is disabled otherwise.
3. If SSTAT.0 = 1, the following Serial Port additional flag bits can cause this interrupt: FE, BR, OE
2
1,3
1,3
Interrupt
flag bit(s)
TI & RI
RI
WDOVF/
RTCF
TI006BhEST (IEN1.6)P1H.6, IP1.610No
Vector
address
0023h
0053h
Interrupt
enable bit(s)
ES/ESR
(IEN0.4)
EWDRT
(IEN0.6)
Interrupt
priority
IP0H.4, IP0.411No
IP0H.6, IP0.63Yes
P89LPC920/921/922
Arbitration
ranking
Power down
wakeup
The P89LPC920/921/922 has two external interrupt inputs in addition to the Keypad Interrupt function. The two interrupt inputs
are identical to those present on the standard 80C51 microcontrollers.
These external interrupts can be programmed to be level-triggered or edge-triggered by clearing or setting bit IT1 or IT0 in
Register TCON. If ITn = 0, external interrupt n is triggered by a low level detected at the INTn
is edge triggered. In this mode if consecutive samples of the INTn pin show a high level in one cycle and a low level in the next
cycle, interrupt request flag IEn in TCON is set, causing an interrupt request.
Since the external interrupt pins are sampled once each machine cycle, an input high or low level should be held for at least one
machine cycle to ensure proper sampling. If the external interrupt is edge-triggered, the external source has to hold the request
pin high for at least one machine cycle, and then hold it low for at least one machine cycle. This is to ensure that the transition is
detected and that interrupt request flag IEn is set. IEn is automatically cleared by the CPU when the service routine is called.
If the external interrupt is level-triggered, the external source must hold the request active until the requested interrupt is
generated. If the external interrupt is still asserted when the interrupt service routine is completed, another interrupt will be
generated. It is not necessary to clear the interrupt flag IEn when the interrupt is level sensitive, it simply tracks the input pin level.
If an external interrupt is enabled when the P89LPC920/921/922 is put into Power down or Idle mode, the interrupt occurance
will cause the processor to wake up and resume operation. Refer to the section on Power Reduction Modes for details.
pin. If ITn = 1, external interrupt n
External Interrupt pin glitch suppression
Most of the P89LPC920/921/922 pins have glitch suppression circuits to reject short glitches (please refer to the P89LPC920/
921/922 datasheet, AC Electrical Characteristics for glitch filter specifications) . However, pins SDA/INT0
do not have the glitch suppression circuits. Therefore, INT1
has glitch suppression while INT0 does not.
/P1.3 and SCL/T0/P1.2
2003 Nov 6 26
Philips Semiconductors
User’s Manual - Preliminary -
INTERRUPTS
RTCF
ERTC
(RTCCON.1)
WDOVF
IE0
EX0
IE1
EX1
BOPD
EBO
KBIF
EKBI
EWDRT
CMF2
CMF1
EC
EA (IE0.7)
TF0
ET0
TF1
ET1
TI & RI/RI
ES/ESR
EST
EI2C
P89LPC920/921/922
Wakeup (if in
Power down)
TI
SI
Interrupt to CPU
Figure 3-1: Interrupt sources, interrupt enables, and power down wake-up sources
2003 Nov 6 27
Philips Semiconductors
User’s Manual - Preliminary -
INTERRUPTS
P89LPC920/921/922
2003 Nov 6 28
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC920/921/922
I/O PORTS
4. I/O PORTS
The P89LPC920/921/922 has 3 I/O ports: Port 0, Port 1, and Port 3. Ports 0 and 1 are 8-bit ports and Port 3 is a 2-bit port. The
exact number of I/O pins available depends upon the clock and reset options chosen (see Table 4-1)
Table 4-1: .Number of I/O pins available
Clock sourceReset optionNumber of I/O pins
On-chip oscillator or watchdog
oscillator
External clock input
No external reset (except during power-up)18
External RST
No external reset (except during power-up)17
External RST
pin supported17
pin supported16
Low/medium/high speed oscillator
(external crystal or resonator)
No external reset (except during power-up)16
External RST
pin supported15
Port configurations
All but three I/O port pins on the P89LPC920/921/922 may be configured by software to one of four types on a pin-by-pin basis,
as shown in Table 4-3. These are: quasi-bidirectional (standard 80C51 port outputs), push-pull, open drain, and input-only. Two
configuration registers for each port select the output type for each port pin.
P1.5 (RST) can only be an input and cannot be configured.
P1.2 (SCL/T0) and P1.3 (SDA/INT0) may only be configured to be either input-only or open drain.
Table 4-2: Port output configuration settings
PxM1.yPxM2.yPort output mode
00Quasi-bidirectional
01Push-Pull
10Input Only (High Impedance)
11Open Drain
Quasi-bidirectional output configuration
Quasi-bidirectional outputs can be used both as an input and output without the need to reconfigure the port. This is possible
because when the port outputs a logic high, it is weakly driven, allowing an external device to pull the pin low. When the pin is
driven low, it is driven strongly and able to sink a large current. There are three pull-up transistors in the quasi-bidirectional output
that serve different purposes.
One of these pull-ups, called the “very weak” pull-up, is turned on whenever the port latch for the pin contains a logic 1. This very
weak pull-up sources a very small current that will pull the pin high if it is left floating.
A second pull-up, called the “weak” pull-up, is turned on when the port latch for the pin contains a logic 1 and the pin itself is also
at a logic 1 level. This pull-up provides the primary source current for a quasi-bidirectional pin that is outputting a 1. If this pin is
pulled low by an external device, the weak pull-up turns off, and only the very weak pull-up remains on. In order to pull the pin
low under these conditions, the external device has to sink enough current to overpower the weak pull-up and pull the port pin
below its input threshold voltage.
2003 Nov 6 29
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC920/921/922
I/O PORTS
The third pull-up is referred to as the “strong” pull-up. This pull-up is used to speed up low-to-high transitions on a quasibidirectional port pin when the port latch changes from a logic 0 to a logic 1. When this occurs, the strong pull-up turns on for two
CPU clocks quickly pulling the port pin high .
The quasi-bidirectional port configuration is shown in Figure 4-1.
Although the P89LPC920/921/922 is a 3 V device most of the pins are 5 V-tolerant. If 5 V is applied to a pin configured in quasibidirectional mode, there will be a current flowing from the pin to VDD causing extra power consumption. Therefore, applying 5 V
to pins configured in quasi-bidirectional mode is discouraged.
A quasi-bidirectional port pin has a Schmitt-triggered input that also has a glitch suppression circuit.
(Please refer to the P89LPC920/921/922 datasheet, AC Electrical Characteristics for glitch filter specifications)
port latch data
2 CPU
clock delay
V
DD
strong
V
DD
very
weak
V
DD
weak
port
pin
input data
Figure 4-1: Quasi-bidirectional output
glitch rejection
Open drain output configuration
The open drain output configuration turns off all pull-ups and only drives the pulldown transistor of the port pin when the port latch
contains a logic 0. To be used as a logic output, a port configured in this manner must have an external pull-up, typically a resistor
tied to V
The open drain port configuration is shown in Figure 4-2.
An open drain port pin has a Schmitt-triggered input that also has a glitch suppression circuit.
Please refer to the P89LPC920/921/922 datasheet, AC Electrical Characteristics for glitch filter specifications).
. The pulldown for this mode is the same as for the quasi-bidirectional mode.
DD
port latch data
input data
glitch rejection
port
pin
Figure 4-2: Open drain output
2003 Nov 6 30
Loading...
+ 93 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.