The P89LPC932A1 is a single-chip microcontroller designed for applications demanding
high-integration, low cost solutions over a wide range of performance requirements. The
P89LPC932A1 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 P89LPC932A1 in order to reduce
component count, board space, and system cost.
1.1Comparison to the P89LPC932 device
The P89LPC932A1 includes several improvements compared to the P89LPC932. These
improvements are described below.
1.1.1Byte-erasability (IAP-Lite)
The original P89LPC932 allowed from 1 byte to 64 bytes of user code memory, in a single
page, to be programmed using an IAP function call. The bytes to be programmed needed
to have been previously erased using either a page erase, sector erase, or chip erase (in a
parallel programmer) command. Thus code memory was erased in 64 byte, 1 kB, or 8 kB
groups. The P89LPC932A1 allows from 1 byte to 64 bytes of a page of user code memory
to be erased and reprogrammed in a single operation. The bytes to be erased and
reprogrammed may be randomly addressed within a single page. Only the bytes so
addressed will be affected. See Section 18.4 “
page 109.
1.1.2Serial in-circuit programming (ICP)
UM10109
P89LPC932A1 User manual
Using Flash as data storage: IAP-Lite” on
In-Circuit Programming is a method intended to allow low cost commercial programmers
to program and erase these devices without removing the microcontroller from the
system. The In-Circuit Programming facility consists of a series of internal hardware
resources to facilitate remote programming of the P89LPC932A1 through a two-wire serial
interface. Philips has made in-circuit programming in an embedded application possible
with a minimum of additional expense in components and circuit board area. The ICP
function uses five pins (V
be available to interface your application to an external programmer in order to use this
feature. This function was not available on the P89LPC932 device.
1.1.3‘On-the-fly’ clock selection
The RC Oscillator can be selected as the source for the CPU clock (CCLK) by using the
RCCLK bit in the TRIM register (TRIM.7). This bit allows for fast ‘on-the-fly’ switching
between the RC Oscillator and the clock source selected by the oscillator type select bits,
FOSC[2:0], in UCFG1, without the need to reset the device. This functionality was not
available on the P89LPC932. See Table 5 “
address 96h) bit description” on page 22.
, VSS, P0.5, P0.4, and RST). Only a small connector needs to
The ISP code has been modified to set the WDT prescaler (in WDCON) and WDL register
to their maximum values. Other WDCON bits are unchanged and the ISP code does not
explicitly enable or disable the WDT. Periodic feeds are provided within the ISP code to
support applications that entered the ISP code with an enabled WDT. This functionality
was not provided in the ISP code on the P89LPC932.
1.1.4.2XDATA data buffer option added for programming code memory
The “program user code page” function on the P89LPC932 used IDATA as the 64 byte
data buffer. An option is provided to allow the user to specify that XDATA is to be used
instead as the buffer source. If the F1 flag (PSW.1) is set, then XDATA is used. If the F1
flag (PSW.1) is cleared, then IDATA is used.
1.1.4.3Port 0 initialization
On the P89LPC932 the ISP code during initialization programmed all bits of Port 0 to the
quasi-bidirectional mode and set these port pins HIGH. This has been changed such that
only the TxD and RxD pins have their port mode programmed during ISP initialization. All
other Port 0 pins remain in their previous state (for example, input-only mode following a
reset).
UM10109
P89LPC932A1 User manual
1.1.4.4Direct load of UART baud rate fix
A bug identified in the “direct load of baud rate” ISP function has been fixed. The baud rate
source for this function has been changed from Timer 1 to the BRG.
1.1.4.5Boot Vector and IAP entry points modified
To protect against errant code execution incrementing into the ISP or IAP routines,
software reset instructions have been added to the beginning of these code blocks. This
required that the ISP and IAP entry points be changed. The ISP entry point has changed
to 1F00H resulting in a default Boot Vector of 1FH. The IAP entry point has changed to
FF03H.
1.1.4.6IAP authorization key
IAP functions which write or erase code memory require an authorization key be set by
the calling routine prior to performing the IAP function call. This authorization key is set by
writing 96H to RAM location FFH. See Section 18.13 “
After the function call is processed by the IAP routine, the authorization key will be
cleared. Thus it is necessary for the authorization key to be set prior to EACH call to
PGM_MTP that requires a key. If an IAP routine that requires an authorization key is
called without a valid authorization key present, the MCU will perform a reset.
1.1.4.7Hardware write enable (WE) key
This device has hardware write enable protection. This protection applies to both ISP and
IAP modes and applies to both the user code memory space and the user configuration
bytes (UCFG1, BOOTVEC, and BOOTSTAT). This protection does not apply to
commercial programmer modes. When enabled, user code requesting a write function via
IAP or IAP-Lite will need to explicitly set a Write Enable flag prior to requesting the write
function. See Section 18.14 “
A separate write protection bit has been provided for the “configuration bytes”. These
bytes include UCFG1, BootStat, Boot Vector, and the sector security bytes. This write
protection applies for ISP and IAP modes. It does not apply to commercial programmer
modes. See Section 18.15 “
1.1.5Previous errata fix
Most known errata on the P89LPC932 devices has been fixed on the P89LPC932A1
device. For current errata information on the P89LPC932A1, if any, please see the
P89LPC932A1 errata sheet.
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 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 4.1 “Port configurations” and
the P89LPC932A1 data sheet, Static 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:
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 1 pins as inputs and outputs depends
upon the port configuration selected. Each of the configurable port pins
are programmed independently. Refer to Section 4.1 “
and the P89LPC932A1 data sheet, Static characteristics for details.
P1.2 to P1.3 are open drain when used as outputs. P1.5 is input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below:
when used as output).
2
— External interrupt 0 input.
2
— External interrupt 1 input.
— 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.
When using an oscillator 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
specified level. When system power is removed V
the minimum specified operating voltage. When using an oscillator
frequency above 12 MHz, in some applications, an external
brownout detect circuit may be required to hold the device in reset
when V
DD
Port configurations”
C serial clock input/output.
C serial data input/output.
has reached its
DD
falls below the minimum specified operating voltage.
I/OPort 2: Port 2 is an 8-bit I/O port with a user-configurable output type.
During reset Port 2 latches are configured in the input only mode with the
internal pull-up disabled. The operation of Port 2 pins as inputs and
outputs depends upon the port configuration selected. Each port pin is
configured independently. Refer to Section 4.1 “
the P89LPC932A1 data sheet, Static characteristics for details.
All pins have Schmitt triggered inputs.
Port 2 also provides various special functions as described below:
IICB — Input Capture B
OOCD — Output Compare D
I/OMOSI — SPI master out slave in. When configured as master, this pin is
output; when configured as slave, this pin is input.
I/OMISO — When configured as master, this pin is input, when configured
as slave, this pin is output.
ISS
I/OSPICLK — SPI clock. When configured as master, this pin is output;
P3.0 to P3.1 9, 85, 4I/OPort 3: Port 3 is a 2-bit I/O port with a user-configurable output type.
95 I/OP3.0 — Port 3 bit 0.
84 I/OP3.1 — Port 3 bit 1.
V
SS
V
DD
73 IGround: 0 V reference.
2117IPower Supply: This is the power supply voltage for normal operation as
…continued
HVQFN28
During reset Port 3 latches are configured in the input only mode with the
internal pull-up 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 Section 4.1data sheet, Static 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 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.
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.
well as Idle and Power-down modes.
and the P89LPC932A1
[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
C slave address registerDBHI2ADR.6I2ADR.5I2ADR.4I2ADR.3I2ADR.2I2ADR.1I2ADR.0GC000000 0000
Bit addressDFDEDDDCDBDAD9D8
2
C control registerD8H-I2ENSTASTOSIAA-CRSEL00x000 00x0
2
C data registerDAH
DDH000000 0000
duty cycle register high
DCH000000 0000
duty cycle register low
2
C status registerD9HSTA.4STA.3STA.2STA.1STA.0000F81111 1000
ABH000000 0000
high
AAH000000 0000
low
AFH000000 0000
high
AEH000000 0000
low
Bit addressAFAEADACABAAA9A8
Bit addressEFEEEDECEBEAE9E8
Bit addressBFBEBDBCBBBAB9B8
Bit addressFFFEFDFCFBFAF9F8
MSBLSBHexBinary
[1]
[1]
PT1HPX1HPT0HPX0H00
PSRH
[1]
[1]
[1]
00x0 0000
x000 0000
x000 0000
00x0 0000
00x0 0000
Philips Semiconductors
P89LPC932A1 User manual
UM10109
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
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
WDCONWatchdog control registerA7HPRE2PRE1PRE0--WDRUNWDTOFWDCLK
WDLWatchdog loadC1HFF1111 1111
WFEED1Watchdog feed 1C2H
WFEED2Watchdog feed 2C3H
[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 P89LPC932A1 reset. Upon a power-up reset, all reset source flags are cleared except POF and BOF; the power-on reset value is
[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.
[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 P89LPC932A1 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 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 P89LPC932A1 has 8 kB of on-chip Code memory.
The P89LPC932A1 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 P89LPC932A1 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 Figure 6
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
P89LPC932A1 User manual
CPU Clock (CCLK) modification: DIVM register”). Note: f
CCLK
⁄2.
UM10109
and
is defined as the
osc
2.2.1Oscillator Clock (OSCCLK)
The P89LPC932A1 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.
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 12 MHz. Ceramic
resonators are also supported in this configuration.
2.3Clock output
The P89LPC932A1 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 P89LPC932A1. 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 other bits 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.
UM10109
2.4On-chip RC oscillator option
The P89LPC932A1 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, ± 1 %. (Note: the initial value is better than
1 %; please refer to the P89LPC932A1 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 4:On-chip RC oscillator trim register (TRIM - address 96h) bit allocation
Reset00Bits 5:0 loaded with factory stored value during reset.
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,
1TRIM.1
2TRIM.2
3TRIM.3
4TRIM.4
5TRIM.5
6ENCLKwhen = 1,
7RCCLKwhen = 1, selects the RC Oscillator output as the CPU clock (CCLK). This allows for
these bits are 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.
CCLK
being used.
fast switching between any clock source and the internal RC oscillator without
needing to go through a reset cycle. The original P89LPC932 required a reset
cycle in order to switch between clock sources.
⁄2 is output on the XTAL2 pin provided the crystal oscillator is not
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 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
level. When system power is removed VDD will fall below the minimum specified
operating voltage. When using an oscillator frequency above 12 MHz, in some
applications, an external brownout detect circuit may be required to hold the device
in reset when VDD falls below the minimum specified operating voltage.
(1) A series resistor may be required to limit crystal drive levels. This is especially important for low
Fig 6. Using the crystal oscillator.
UM10109
P89LPC932A1 User manual
quartz crystal or
ceramic resonator
P89LPC932A1
XTAL1
(1)
XTAL2
002aab008
Note: The oscillator must be configured in one of the following modes: Low frequency crystal,
medium frequency crystal, or high frequency crystal.
frequency crystals (see text).
XTAL1
XTAL2
(7.3728 MHz ±1 %)
(400 kHz )
HIGH FREQUENCY
MEDIUM FREQUENCY
LOW FREQUENCY
RC
OSCILLATOR
WATCHDOG
OSCILLATOR
+20 %
−30 %
RCCLK
TIMER 0 AND
TIMER 1
OSCCLK
I2C-BUS
PCLK
DIVM
SPI
CCLK
PCLK
÷2
UART
(P89LPC932A1)
Fig 7. Block diagram of oscillator control.
2.7Oscillator Clock (OSCCLK) wake-up delay
The P89LPC932A1 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 µs to 100 µs. If the clock source is
either the internal RC oscillator or the Watchdog oscillator, the delay is 224 OSCCLK
cycles plus 60 µs to 100 µs.
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:
UM10109
P89LPC932A1 User manual
2.9Low power select
3.Interrupts
osc
osc
).
/ (2N)
osc
to f
osc
/510.
CCLK frequency = f
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.
The P89LPC932A1 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 logic 1 to lower the power
consumption further. On any reset, CLKLP is logic 0 allowing highest performance. This
bit can then be set in software if CCLK is running at 8 MHz or slower.
is the frequency of OSCCLK, N is the value of DIVM.
osc
The P89LPC932A1 uses a four priority level interrupt structure. This allows great flexibility
in controlling the handling of the P89LPC932A1’s 15 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. Ta bl e 7
addresses, enable bits, priority bits, arbitration ranking, and whether each interrupt may
wake-up the CPU from a Power-down mode.
summarizes the interrupt sources, flag bits, vector
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 Tab le 7
The P89LPC932A1 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
triggered. In this mode if consecutive samples of the INTn
cycle and a low level in the next cycle, interrupt request flag IEn in TCON is set, causing
an interrupt request.
UM10109
P89LPC932A1 User manual
.
pin. If ITn = 1, external interrupt n is edge
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
P89LPC932A1 is put into Power-down mode or Idle mode, the interrupt occurrence will
cause the processor to wake-up and resume operation. Refer to Section 5.3 “
reduction modes” for details.
3.2External Interrupt pin glitch suppression
Most of the P89LPC932A1 pins have glitch suppression circuits to reject short glitches
(please refer to the P89LPC932A1 data sheet, Dynamic characteristics for glitch filter
specifications). However, pins SDA/INT0
suppression circuits. Therefore, INT1
Fig 8. Interrupt sources, interrupt enables, and power-down wake-up sources.
4.I/O ports
The P89LPC932A1 has four I/O ports: Port 0, Port 1, Port 2, and Port 3. Ports 0, 1, and 2
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 Ta bl e 8
Table 8: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 P89LPC932A1 may be configured by software to one of
four types on a pin-by-pin basis, as shown in Ta b le 9
(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.
UM10109
P89LPC932A1 User manual
. These are: quasi-bidirectional
P1.5 (RST
P1.2 (SCL/T0) and P1.3 (SDA/INT0
open drain.
Table 9:Port output configuration settings
PxM1.yPxM2.yPort output mode
00Quasi-bidirectional
01Push-pull
10Input only (high-impedance)
11Open drain
) can only be an input and cannot be configured.
) may only be configured to be either input-only or
4.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 9
Although the P89LPC932A1 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 P89LPC932A1 data sheet, Dynamic characteristics for glitch filter
specifications).
UM10109
P89LPC932A1 User manual
V
DD
port latch
data
Fig 9. Quasi-bidirectional output.
4.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
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.
The open drain port configuration is shown in Figure 10
.
An open drain port pin has a Schmitt-triggered input that also has a glitch suppression
circuit.
Please refer to the P89LPC932A1 data sheet, Dynamic characteristics for glitch filter
specifications.
The input port configuration is shown in Figure 11. It is a Schmitt-triggered input that also
has a glitch suppression circuit.
(Please refer to the P89LPC932A1 data sheet, Dynamic characteristics for glitch filter
specifications).
UM10109
P89LPC932A1 User manual
input
data
glitch rejection
Fig 11. Input only.
PORT
PIN
002aaa916
4.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 12
A push-pull port pin has a Schmitt-triggered input that also has a glitch suppression
circuit.
(Please refer to the P89LPC932A1 data sheet, Dynamic characteristics for glitch filter
specifications).