The P89LPC924/925 are single-chip microcontrollers designed for applications
demanding high-integration, low cost solutions over a wide range of performance
requirements. The
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
P89LPC924/925 in order to reduce component count, board space, and system cost.
1.1Pin Configuration
UM10108
P89LPC924/925 User manual
P89LPC924/925 is based on a high performance processor
P0.0 to P0.7I/OPort 0: Port 0 is an 8-bit I/O port with a user-configurable output type. During reset
Por t 0 latches are configured in the input only mode with the internal pull-up disabled.
The operation of Port
selected. Each port pin is configured independently. Refer to Section 5.1 “Port
configurations” for details.
The Keypad Interrupt feature operates with Port 0 pins.
All pins have Schmitt triggered inputs.
Por t 0 also provides various special functions as described below:
1I/OP0.0 — Por t 0 bit 0.
OCMP2 — Comparator 2 output.
IKBI0 — Keyboard input 0.
20I/OP0.1 — Port 0 bit 1.
ICIN2B — Comparator 2 positive input B.
IKBI1 — Keyboard input 1.
IAD10 — ADC1 channel 0 analog input.
19I/OP0.2 — Port 0 bit 2.
ICIN2A — Comparator 2 positive input A.
IKBI2 — Keyboard input 2.
IAD11 — ADC1 channel 1analog input.
18I/OP0.3 — Port 0 bit 3.
ICIN1B — Comparator 1 positive input B.
IKBI3 — Keyboard input 3.
IAD12 — ADC1 channel 2 analog input.
17I/OP0.4 — Port 0 bit 4.
ICIN1A — Comparator 1 positive input A.
IKBI4 — Keyboard input 4.
IAD13 — ADC1 channel 3 analog input.
IDAC1 — Digital-to-analog converter output 1.
16I/OP0.5 — Port 0 bit 5.
ICMPREF — Comparator reference (negative) input.
IKBI5 — Keyboard input 5.
14I/OP0.6 — Port 0 bit 6.
OCMP1 — Comparator 1 output.
IKBI6 — Keyboard input 6.
13I/OP0.7 — Port 0 bit 7.
I/OT1 — Timer/counter 1 external count input or overflow output.
IKBI7 — Keyboard input 7.
0 pins as inputs and outputs depends upon the port configuration
10I/OP1.2 — Port 1 bit 2 (open-drain when used as output).
9I/OP1.3 — Por t 1 bit 3 (open-drain when used as output).
8I/OP1.4 — Por t 1 bit 4.
4IP1.5 — Por t 1 bit 5 (input only).
3I/OP1.6 — Por t 1 bit 6.
2I/OP1.7 — Por t 1 bit 7.
[1]
Port 1: Port 1 is an 8-bit I/O port with a user-configurable output type, except for three
pins as noted below. During reset Port 1 latches are configured in the input only mode
with the internal pull-up disabled. The operation of the configurable Port
and outputs depends upon the port configuration selected. Each of the configurable port
pins are programmed independently. Refer to Section 5.1 “Port configurations” for
details.
P1.2 and P1.3 are open drain when used as outputs. P1.5 is input only.
All pins have Schmitt triggered inputs.
Por t 1 also provides various special functions as described below:
OTXD — Transmitter output for the serial port.
IRXD — Receiver input for the serial port.
I/OT0 — Timer/counter 0 external count input or overflow output (open-drain when used as
output).
I/OSCL — I2C serial clock input/output.
IINT0 — External interrupt 0 input.
I/OSDA — I2C serial data input/output.
IINT1 — External interrupt 1 input.
IRST — 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
frequency above 12 MHz, the reset input function of P1.5 must be enabled. An
external circuit is required to hold the device in reset at powerup until V
reached its specified level. When system power is removed V
minimum specified operating voltage. When using an oscillator frequency above
MHz, in some applications, an external brownout detect circuit may be
12
required to hold the device in reset when V
operating voltage.
P3.0 to P3.1I/OPort 3: Port 3 is an 2-bit I/O port with a user-configurable output type. During reset
Por t 3 latches are configured in the input only mode with the internal pull-up disabled.
The operation of Port
selected. Each port pin is configured independently. Refer to Section 5.1 “Port
configurations” for details.
All pins have Schmitt triggered inputs.
Por t 3 also provides various special functions as described below:
7I/OP3.0 — Por t 3 bit 0.
OXTAL2 — Output from the oscillator amplifier (when a crystal oscillator option is
selected via the FLASH configuration.
OCLKOUT — CPU 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.
6I/OP3.1 — Por t 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: 0 V reference.
15IPower Supply: This is the power supply voltage for normal operation as well as Idle
and Power-down modes.
3 pins as inputs and outputs depends upon the port configuration
UM10108
[1] Input/Output for P1.0 to P1.4, P1.6, P1.7. Input for P1.5.
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
Program Flash control (Write) E4HFMCMD.7FMCMD.6FMCMD.5FMCMD.4FMCMD.3FMCMD.2FMCMD.1FMCMD.
Bit addressDFDEDDDCDBDAD9D8
DDH0000000000
duty cycle register HIGH
DCH0000000000
duty cycle register LOW
Bit addressAFAEADACABAAA9A8
Bit addressEFEEEDECEBEAE9E8
Bit addressBFBEBDBCBBBAB9B8
Bit addressFFFEFDFCFBFAF9F8
86H0000000000
register
MSBLSBHexBinary
0
PT1HPX1HPT0HPX0H00
PSRH
KBIF00
_SEL
[1]
[1]
[1]
[1]
[1]
[1]
[1]
00000000
00x00000
x0000000
x0000000
00x00000
00x00000
xxxxxx00
Philips Semiconductors
P89LPC924/925 User manual
UM10108
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
[1] All por ts 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 P89LPC924/925 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., PRE2-PRE0 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.
P89LPC924/925 User manual
UM10108
Philips Semiconductors
1.3Memory organization
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
IDATA routines
entry points for:
-51 ASM. code
-C code
ISP serial loader
entry points for:
-UART (auto-baud)
-I2C, SPI, etc.*
Flexible choices:
-as supplied (UART)
-Philips libraries*
-user-defined
FFEFh
FF1Fh
FF00h
1FFFh
1E00h
entry
points
SPECIAL FUNCTION
REGISTERS
(DIRECTLY ADDRESSABLE)
UM10108
P89LPC924/925 User manual
IDATA (incl. DATA)
128 BYTES ON-CHIP
DATA MEMORY (STACK
AND INDIR. ADDR.)
DATA
128 BYTES ON-CHIP
DATA MEMORY (STACK,
DIRECT AND INDIR. ADDR.)
4 REG. BANKS R[7:0]
data memory
(DATA, IDATA)
002aaa948
Note: ISP code is located at the end of Sector 4 on the LPC924, and at the end of Sector 7 on the LPC925.
Fig 3. P89LPC924/925 memory map.
The various P89LPC924/925 memory spaces are as follows:
DATA — 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.
IDATA — 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
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
Table 3:Data RAM arrangement
TypeData RAMSize (bytes)
DATADirectly and indirectly addressable memory128
IDATAIndirectly addressable memory256
bytes
P89LPC924/925 has 4 kB/8 kB of on-chip Code memory.
The P89LPC924/925 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 definitions
The P89LPC924/925 device has several internal clocks as defined below:
OSCCLK — Input to the DIVM clock divider. OSCCLK is selected from one of four clock
sources and can also be optionally divided to a slower frequency (see
Section 2.8 “CPU Clock (CCLK) modification: DIVM register”). Note: f
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 CCLK/2.
UM10108
P89LPC924/925 User manual
Figure 5 and
is defined as the
osc
2.2.1Oscillator Clock (OSCCLK)
The P89LPC924/925 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 18 MHz.
2.2.2Low 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.
2.2.3Medium 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.
2.2.4High speed oscillator option
This option supports an external crystal in the range of 4 MHz to 18 MHz. Ceramic
resonators are also supported in this configuration.When using an oscillator frequency
above 12
is required to hold the device in reset at powerup until V
level. When system power is removed V
operating voltage. When using an oscillator frequency above 12
applications, an external brownout detect circuit may be required to hold the device
in reset when V
MHz, the reset input function of P1.5 must be enabled. An external circuit
falls below the minimum specified operating voltage.
The P89LPC924/925 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
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.
UM10108
P89LPC924/925 User manual
P89LPC924/925. This
quartz crystal or
ceramic resonator
P89LPC924/925
XTAL1
[1]
Note: The oscillator must be configured in one of the following modes: Low frequency crystal,
medium frequency crystal, or high frequency crystal.
(1) A series resistor may be required to limit crystal drive levels. This is especially important for low
frequency crystals (see text).
Fig 4. Using the crystal oscillator.
XTAL2
002aaa951
2.4On-chip RC oscillator option
The P89LPC924/925 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
better than 1
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.
%; please refer to the data sheet for behavior over temperature). End user
MHz, ± 1 %. (Note: the initial value is
Table 4:On-chip RC oscillator trim register (TRIM - address 96h) bit allocation
Table 5: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 reset, these bits are
1TRIM.1
2TRIM.2
3TRIM.3
4TRIM.4
5TRIM.5
6ENCLKwhen = 1, CCLK/2 is output on the XTAL2 pin provided the crystal oscillator is not being used.
7RCCLKwhen = 1, selects the RC Oscillator output as the CPU clock (CCLK)
loaded with a stored factory calibration value. When writing 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.
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
XTAL1 / P3.1 pin. The rate may be from 0
Hz up to 18 MHz. The XTAL2 / P3.0 pin may be
used as a standard port pin or a clock output. When using an oscillator frequency
above 12
is required to hold the device in reset at powerup until V
level. When system power is removed V
operating voltage. When using an oscillator frequency above 12
MHz, the reset input function of P1.5 must be enabled. An external circuit
has reached its specified
DD
will fall below the minimum specified
DD
MHz, in some
applications, an external brownout detect circuit may be required to hold the device
in reset when V
falls below the minimum specified operating voltage.
The P89LPC924/925 has an internal wake-up 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
either the internal RC oscillator or the Watchdog oscillator, the delay is 224 OSCCLK
cycles plus 60
2.8CPU 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:
UM10108
P89LPC924/925 User manual
µs to 100 µs. If the clock source is
µs to 100 µs.
Where: f
Since N ranges from 0 to 255, the CCLK frequency can be in the range of f
(for N = 0, CCLK = 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 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.
2.9Low power select
The P89LPC924/925 is designed to run at 12 MHz (CCLK) maximum. However, if CCLK
is 8
power consumption further. On any reset, CLKLP is logic
This bit can then be set in software if CCLK is running at 8
3.A/D converter
CCLK frequency = f
is the frequency of OSCCLK
osc
N is the value of DIVM.
osc
osc
).
/ (2N)
osc
to f
MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to a logic 1 to lower the
0 allowing highest performance.
MHz or slower.
osc
/510.
The P89LPC924/925 has an 8-bit, 4-channel, multiplexed successive approximation
analog-to-digital converter module (ADC1) and one DAC module (DAC1). A block diagram
of the A/D converter is shown in
feeds a sample and hold circuit providing an input signal to one of two comparator inputs.
The control logic in combination with the successive approximation register (SAR) drives a
digital-to-analog converter which provides the other input to the comparator. The output of
the comparator is fed to the SAR.
A single input channel can be selected for conversion. A single conversion will be
performed and the result placed in the result register which corresponds to the selected
input channel (See
completes. The input channel is selected in the ADINS register. This mode is selected by
setting the SCAN1 bit in the ADMODA register.
Table 6:Input channels and Result registers for fixed channel single, auto scan single,
Result register Input channelResult register Input channel
AD1DAT0AD10AD1DAT2AD12
AD1DAT1AD11AD1DAT3AD13
3.2.2Fixed channel, continuous conversion mode
A single input channel can be selected for continuous conversion. The results of the
conversions will be sequentially placed in the four result registers
enabled, will be generated after every four conversions. Additional conversion results will
again cycle through the four result registers, overwriting the previous results. Continuous
conversions continue until terminated by the user. This mode is selected by setting the
SCC1 bit in the ADMODA register.
UM10108
P89LPC924/925 User manual
Ta bl e 6). An interrupt, if enabled, will be generated after the conversion
and autoscan continuous conversion modes.
Ta bl e 7. An interrupt, if
3.2.3Auto scan, single conversion mode
Any combination of the four input channels can be selected for conversion by setting a
channel’s respective bit in the ADINS register. The channels are converted from LSB to
MSB order (in ADINS). A single conversion of each selected input will be performed and
the result placed in the result register which corresponds to the selected input channel
(See
Ta bl e 6). An interrupt, if enabled, will be generated after all selected channels have
been converted. If only a single channel is selected this is equivalent to single channel,
single conversion mode. This mode is selected by setting the SCAN1 bit in the ADMODA
register.
Table 7:Result registers and conversion results for fixed channel, continuous conversion
mode.
Result registerContains
AD1DAT0Selected channel, first conversion result
AD1DAT1Selected channel, second conversion result
AD1DAT2Selected channel, third conversion result
AD1DAT3Selected channel, forth conversion result
3.2.4Auto scan, continuous conversion mode
Any combination of the four input channels can be selected for conversion by setting a
channel’s respective bit in the ADINS register. The channels are converted from LSB to
MSB order (in ADINS). A conversion of each selected input will be performed and the
result placed in the result register which corresponds to the selected input channel (See
Ta bl e 6). An interrupt, if enabled, will be generated after all selected channels have been
converted. The process will repeat starting with the first selected channel. Additional
conversion results will again cycle through the result registers of the selected channels,
overwriting the previous results. Continuous conversions continue until terminated by the
user. This mode is selected by setting the BURST1 bit in the ADMODA register.
3.2.5Dual channel, continuous conversion mode
Any combination of two of the four input channels can be selected for conversion. The
result of the conversion of the first channel is placed in the first result register. The result of
the conversion of the second channel is placed in the second result register. The first
channel is again converted and its result stored in the third result register. The second
channel is again converted and its result placed in the fourth result register (See
An interrupt is generated, if enabled, after every set of four conversions (two conversions
per channel). This mode is selected by setting the SCC1 bit in the ADMODA register.
Table 8:Result registers and conversion results for dual channel, continuous conversion
Result registerContains
AD1DAT0First channel, first conversion result
AD1DAT1 Second channel, first conversion result
AD1DAT2First channel, second conversion result
AD1DAT3Second channel, second conversion result
UM10108
P89LPC924/925 User manual
Ta bl e 8).
mode.
3.2.6Single step
This special mode allows ‘single-stepping’ in an auto scan conversion mode. Any
combination of the four input channels can be selected for conversion. After each channel
is converted, an interrupt is generated, if enabled, and the A/D waits for the next start
condition. The result of each channel is placed in the result register which corresponds to
the selected input channel (See
mode is selected by clearing the BURST1, SCC1, and SCAN1 bits in the ADMODA
register.
Ta bl e 6). May be used with any of the start modes. This
3.2.7Conversion mode selection bits
The A/D uses three bits in ADMODA to select the conversion mode. These mode bits are
summarized in
shown, are undefined.
Table 9:Conversion mode bits.
BURST1 SCC1 Scan1 ADC1 conversion
000single step000single step
001fixed
010fixed channel,
100auto scan,
Ta bl e 9, below. Combinations of the three bits, other than the combinations
An A/D conversion is started by the overflow of Timer 0. Once a conversion has started,
additional Timer 0 triggers are ignored until the conversion has completed. The Timer
triggered start mode is available in all A/D operating modes. This mode is selected by the
TMM1 bit and the ADCS11 and ADCS10 bits (See
3.3.2Start immediately
Programming this mode immediately starts a conversion. This start mode is available in all
A/D operating modes. This mode is selected by setting the ADCS11 and ADCS10 bits in
the ADCON1 register (See
3.3.3Edge triggered
An A/D conversion is started by rising or falling edge of P1.4. Once a conversion has
started, additional edge triggers are ignored until the conversion has completed. The edge
triggered start mode is available in all A/D operating modes. This mode is selected by
setting the ADCS11 and ADCS10 bits in the ADCON1 register (See
UM10108
P89LPC924/925 User manual
Ta bl e 11).
Ta bl e 11).
Ta bl e 11).
3.3.4Boundary limits interrupt
The A/D converter has both a HIGH and LOW boundary limit register. After the four MSBs
have been converted, these four bits are compared with the four MSBs of the boundary
HIGH and LOW registers. If the four MSBs of the conversion are outside the limit an
interrupt will be generated, if enabled. If the conversion result is within the limits, the
boundary limits will again be compared after all eight bits have been converted. An
interrupt will be generated, if enabled, if the result is outside the boundary limits. The
boundary limit may be disabled by clearing the boundary limit interrupt enable.
3.4DAC output to a port pin with high-impedance
The AD0DAT3 register is used to hold the value fed to the DAC. After a value has been
written to AD0DAT3 the DAC output will appear on the DAC0 pin. The DAC output is
enabled by the ENDAC0 bit in the ADMODB register (See
3.5Clock divider
The A/D converter requires that its internal clock source be in the range of 500 kHz to
3.3
MHz to maintain accuracy. A programmable clock divider that divides the clock from 1
to 8 is provided for this purpose (See
Ta bl e 15).
3.6I/O pins used with A/D converter functions
The analog input pins used with for the A/D converter have a digital input and output
function. In order to give the best analog performance, pins that are being used with the
ADC or DAC should have their digital outputs and inputs disabled and have the 5
tolerance disconnected. Digital outputs are disabled by putting the port pins into the
input-only mode as described in the Port Configurations section (see
Digital inputs will be disconnected automatically from these pins when the pin has been
selected by setting its corresponding bit in the ADINS register and the A/D or DAC has
been enabled. Pins selected in ADINS will be 3
and the device is not in power-down, otherwise the pin will remain 5
P89LPC924/925 User manual
V tolerant provided that the A/D is enabled
UM10108
V tolerant.
3.7Power-down and idle mode
In idle mode the A/D converter, if enabled, will continue to function and can cause the
device to exit idle mode when the conversion is completed if the A/D interrupt is enabled.
In Power-down mode or Total Power-down mode, the A/D does not function. If the A/D is
enabled, it will consume power. Power can be reduced by disabling the A/D.
Table 10:A/D Control register 1 (ADCON1 - address 97h) bit allocation
The P89LPC924/925 uses a four priority level interrupt structure. This allows great
flexibility in controlling the handling of the
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.
addresses, enable bits, priority bits, arbitration ranking, and whether each interrupt may
wake up the CPU from a Power-down mode.
UM10108
P89LPC924/925 User manual
P89LPC924/925’s 12 interrupt sources.
Ta bl e 19 summarizes the interrupt sources, flag bits, vector
4.1Interrupt priority structure
Table 18:Interrupt priority level
Priority bits
IPxHIPxInterrupt priority level
00Level 0 (lowest priority)
01Level 1
10Level 2
11Level 3
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
The P89LPC924/925 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
triggered. In this mode if consecutive samples of the
cycle and a LOW level in the next cycle, interrupt request flag IEn in TCON is set, causing
an interrupt request.
Ta bl e 18.
INTn pin. If ITn = 1, external interrupt n is edge
INTn pin show a HIGH level in one
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 has been programmed as level-triggered and is enabled when the
P89LPC924/925 is put into Power-down or Idle mode, the interrupt occurrence will cause
the processor to wake up and resume operation. Refer to
modes” on page 32 for details.
4.2External Interrupt pin glitch suppression
Most of the P89LPC924/925 pins have glitch suppression circuits to reject short glitches
(please refer to the
specifications). However, pins SDA/
suppression circuits. Therefore,
UM10108
P89LPC924/925 User manual
Section 6.3 “Power reduction
P89LPC924/925 data sheet, Dynamic characteristics for glitch filter
INT0/P1.3 and SCL/T0/P1.2 do not have the glitch
INT1 has glitch suppression while INT0 does not.
Table 19:Summary of interrupts
DescriptionInterrupt flag
bit(s)
External interrupt 0IE00003hEX0 (IEN0.0)IP0H.0,IP0.0 1 (highest)Ye s
Fig 7. Interrupt sources, interrupt enables, and power-down wake up sources.
5.I/O ports
The P89LPC924/925 has three 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 20: Number of I/O pins available
Clock sourceReset optionNumber of I/O
On-chip oscillator or Watchdog
oscillator
External clock inputNo external reset (except during power up) 25
Low/medium/high speed oscillator
(external crystal or resonator)
All but three I/O port pins on the P89LPC924/925 may be configured by software to one of
four types on a pin-by-pin basis, as shown in
(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 21: Port output configuration settings
PxM1.yPxM2.yPort output mode
00Quasi-bidirectional
01Push-pull
10Input only (high-impedance)
11Open drain
UM10108
P89LPC924/925 User manual
Ta bl e 21. These are: quasi-bidirectional
5.2Quasi-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.
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 quasi-bidirectional 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 8.
Although the P89LPC924/925 is a 3 V device most of the pins are 5 V-tolerant. If 5 V is
applied to a pin configured in quasi-bidirectional mode, there will be a current flowing from
the pin to V
configured in quasi-bidirectional mode is discouraged.
A quasi-bidirectional port pin has a Schmitt triggered input that also has a glitch
suppression circuit.
causing extra power consumption. Therefore, applying 5 V to pins
DD
Philips Semiconductors
(Please refer to the P89LPC924/925 data sheet, Dynamic characteristics for glitch filter
specifications).
UM10108
P89LPC924/925 User manual
V
DD
port latch
data
Fig 8. Quasi-bidirectional output.
5.3Open drain output configuration
The open drain output configuration turns off all pull-ups and only drives the pull-down
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 9.
DD
2 CPU
CLOCK DELAY
PP P
input
data
very
weak
weakstrong
glitch rejection
port
pin
002aaa914
. The pull-down for this mode is the same as for the quasi-bidirectional mode.
An open drain port pin has a Schmitt triggered input that also has a glitch suppression
circuit.
Please refer to the P89LPC924/925 data sheet, Dynamic characteristics for glitch filter
specifications.
The input port configuration is shown in Figure 10. It is a Schmitt triggered input that also
has a glitch suppression circuit.
(Please refer to the P89LPC924/925 data sheet, Dynamic characteristics for glitch filter
specifications).
UM10108
P89LPC924/925 User manual
input
data
glitch rejection
Fig 10. Input only.
port
pin
002aaa916
5.5Push-pull output configuration
The push-pull output configuration has the same pull-down structure as both the open
drain and the quasi-bidirectional output modes, but provides a continuous strong pull-up
when the port latch contains a logic 1. The push-pull mode may be used when more
source current is needed from a port output.
The push-pull port configuration is shown in Figure 11.
A push-pull port pin has a Schmitt triggered input that also has a glitch suppression circuit.
(Please refer to the P89LPC924/925 data sheet, Dynamic characteristics for glitch filter
specifications).
V
DD
P
strong
port
pin
002aaa917
Fig 11. Push-pull output.
port latch
data
input
data
N
glitch rejection
5.6Port 0 analog functions
The P89LPC924/925 incorporates two Analog Comparators. In order to give the best
analog performance and minimize power consumption, pins that are being used for
analog functions must have both the digital outputs and digital inputs disabled.
Digital outputs are disabled by putting the port pins into the input-only mode as described
in the Port Configurations section (see
Digital inputs on Port 0 may be disabled through the use of the PT0AD register. Bits 1
through 5 in this register correspond to pins P0.1 through P0.5 of Port 0, respectively.
Setting the corresponding bit in PT0AD disables that pin’s digital input. Port bits that have
their digital inputs disabled will be read as logic
port.
On any reset, PT0AD bits 1 through 5 default to logic 0s to enable the digital functions.
5.7Additional port features
After power-up, all pins are in Input-Only mode. Please note that this is different from
the LPC76x series of devices.
• After power-up, all I/O pins except P1.5, may be configured by software.
• Pin P1.5 is input only. Pins P1.2 and P1.3 are configurable for either input-only or
open drain.
UM10108
P89LPC924/925 User manual
Figure 10).
0 by any instruction that accesses the
Every output on the P89LPC924/925 has been designed to sink typical LED drive current.
However, there is a maximum total output current for all ports which must not be
exceeded. Please refer to the
All ports pins that can function as an output have slew rate controlled outputs to limit noise
generated by quickly switching output signals. The slew rate is factory-set to
approximately 10 ns rise and fall times.
Table 22: Port output configuration
Port pinConfiguration SFR bits
PxM1.yPxM2.yAlternate usageNotes
P0.0P0M1.0P0M2.0KBIO, CMP2
P0.1P0M1.1P0M2.1KBI1, CIN2B, AD10 Refer to Section 5.6 “Port 0
P0.2P0M1.2P0M2.2KBI2, CIN2A, AD11
P0.3P0M1.3P0M2.3KBI3, CIN1B, AD12
P0.4P0M1.4P0M2.4KBI4, CIN1A, AD13,
P0.5P0M1.5P0M2.5KBI5, CMPREF
P0.6P0M1.6P0M2.6KBI6, CMP1
P0.7P0M1.7P0M2.7KBI7, T1
P1.0P1M1.0P1M2.0TXD
P1.1P1M1.1P1M2.1RXD
P1.2P1M1.2P1M2.2T0, SCLInput-only or open-drain
P1.3P1M1.3P1M2.3INTO, SDAinput-only or open-drain
P1.4P1M1.4P1M2.4INT1
P1.5P1M1.5P1M2.5RST
P1.6P1M1.6P1M2.6
P89LPC924/925 data sheet for detailed specifications.