The P89LPC933/934/935/936 are single-chip microcontrollers designed for applications
demanding high-integration, low cost solutions over a wide range of performance
requirements. The P89LPC933/934/935/936 are 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
P89LPC933/934/935/936 in order to reduce component count, board space, and system
cost.
1.1Product comparison overview
Ta bl e 1 highlights the differences between the four devices.
P0.0 to P0.7I/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 5.1
for details.
The Keypad Interrupt feature operates with Port 0 pins.
All pins have Schmitt trigger inputs.
Port 0 also provides various special functions as described below:
P0.0/CMP2/
KBI0/AD01
327I/OP0.0 — Port 0 bit 0.
OCMP2 — Comparator 2 output.
IKBI0 — Keyboard input 0.
IAD01 — ADC0 channel 1 analog input. (P89LPC935/936)
P1.2/T0/SCL 128I/OP1.2 — Port 1 bit 2 (open-drain when used as output).
2521I/OP0.2 — Port 0 bit 2.
2420I/OP0.3 — Port 0 bit 3.
2319I/OP0.4 — Port 0 bit 4.
2218I/OP0.5 — Port 0 bit 5.
2016I/OP0.6 — Port 0 bit 6.
1915I/OP0.7 — Port 0 bit 7.
…continued
HVQFN28
ICIN2A — Comparator 2 positive input A.
IKBI2 — Keyboard input 2.
IAD11 — ADC1 channel 1 analog input.
ICIN1B — Comparator 1 positive input B.
IKBI3 — Keyboard input 3.
IAD12 — ADC1 channel 2 analog input.
ICIN1A — Comparator 1 positive input A.
IKBI4 — Keyboard input 4.
ODAC1 — Digital-to-analog converter output 1.
IAD13 — ADC1 channel 3 analog input.
ICMPREF — Comparator reference (negative) input.
IKBI5 — Keyboard input 5.
OCMP1 — Comparator 1 output.
IKBI6 — Keyboard input 6.
I/OT1 — Timer/counter 1 external count input or overflow output.
IKBI7 — Keyboard input 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 1 pins as inputs and outputs depends
upon the port configuration selected. Each of the configurable port pins
are programmed independently. Refer to Section 5.1
P1.3 are open drain when used as outputs. P1.5 is input only.
All pins have Schmitt trigger inputs.
Port 1 also provides various special functions as described below:
117I/OP1.3 — Port 1 bit 3 (open-drain when used as output).
106IP1.4 — Port 1 bit 4.
62IP1.5 — Port 1 bit 5 (input only).
428I/OP1.7 — Port 1 bit 7.
…continued
HVQFN28
IINT0
I/OSDA — I
IINT1
IRST
OOCB — Output Compare B. (P89LPC935/936)
OOCC — Output Compare C. (P89LPC935/936)
IAD00 — ADC0 channel 0 analog input. (P89LPC935/936)
— External interrupt 0 input.
2
C serial data input/output.
— External interrupt 1 input.t
— 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 ISP 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
power-up until V
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 V
minimum specified operating voltage.
P2.0 to P2.7I/OPort 2: Port 2 is an 8-bit I/O port with a user-configurable output type.
P2.0/ICB/
DAC0/AD03
P2.1/OCD/
AD02
P2.2/MOSI139I/OP2.2 — Port 2 bit 2.
P2.3/MISO1410I/OP2.3 — Port 2 bit 3.
P2.4/SS
P2.5/SPICLK 1612I/OP2.5 — Port 2 bit 5.
P2.6/OCA2723I/OP2.6 — Port 2 bit 6.
P2.7/ICA2824I/OP2.7 — Port 2 bit 7.
125I/OP2.0 — Port 2 bit 0.
226I/OP2.1 — Port 2 bit 1.
1511I/OP2.4 — Port 2 bit 4.
…continued
HVQFN28
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 5.1
All pins have Schmitt trigger inputs.
Port 2 also provides various special functions as described below:
IICB — Input Capture B. (P89LPC935/936)
IDAC0 — Digital-to-analog converter output.
IAD03 — ADC0 channel 3 analog input. (P89LPC935/936)
OOCD — Output Compare D. (P89LPC935/936)
IAD02 — ADC0 channel 2 analog input. (P89LPC935/936)
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; when
P3.0 to P3.1I/OPort 3: Port 3 is a 2-bit I/O port with a user-configurable output type.
P3.0/XTAL2/
CLKOUT
P3.1/XTAL84I/OP3.1 — Port 3 bit 1.
V
SS
V
DD
95I/OP3.0 — Port 3 bit 0.
73IGround: 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 5.1
All pins have Schmitt trigger 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 RTC/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
RTC/system timer.
for details.
well as Idle and Power-down modes.
[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.
2
C slave address registerDBHI2ADR.6I2ADR.5I2ADR.4I2ADR.3I2ADR.2I2ADR.1I2ADR.0GC0000000000
Bit addressDFDEDDDCDBDAD9D8
2
C control registerD8H-I2ENSTASTOSIAA-CRSEL00x00000x0
2
C data registerDAH
DDH0000000000
duty cycle register high
DCH0000000000
duty cycle register low
2
C status registerD9HSTA.4STA.3STA.2STA.1STA.0000F811111000
Bit addressAFAEADACABAAA9A8
Bit addressEFEEEDECEBEAE9E8
Bit addressBFBEBDBCBBBAB9B8
Bit addressFFFEFDFCFBFAF9F8
MSBLSBHexBinary
0
[1]
[1]
PT1HPX1HPT0HPX0H00
PSRH
KBIF00
_SEL
[1]
[1]
[1]
[1]
Philips Semiconductors
P89LPC933/934/935/936 User manual
00x00000
x0000000
x0000000
UM10116
00x00000
00x00000
xxxxxx00
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
Table 3:Special function registers - P89LPC933/934
* indicates SFRs that are bit addressable.
NameDescriptionSFR
WDLWatchdog loadC1HFF11111111
WFEED1Watchdog feed 1C2H
WFEED2Watchdog feed 2C3H
[1] All ports are in input only (high-impedance) state after power-up.
[2] BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is logic 0. If any are written while BRGEN = 1, the result is unpredictable.
[3] The RSTSRC register reflects the cause of the UM10116 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 to 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.
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.
0
2
C slave address registerDBHI2ADR.6I2ADR.5I2ADR.4I2ADR.3I2ADR.2I2ADR.1I2ADR.0GC0000000000
Bit addressDFDEDDDCDBDAD9D8
2
C control registerD8H-I2ENSTASTOSIAA-CRSEL00x00000x0
2
C data registerDAH
DDH0000000000
duty cycle register high
DCH0000000000
duty cycle register low
Philips Semiconductors
xx000000
xx000000
P89LPC933/934/935/936 User manual
UM10116
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
TIFR2CCU interrupt flag registerE9HTOIF2TOCF2D TOCF2C TOCF2B TOCF2A-TICF2BTICF2A0000000x00
TISE2CCU interrupt status encode
register
TL0Timer 0 low8AH0000000000
TL1Timer 1 low8BH0000000000
TL2CCU timer lowCCH0000000000
DEH-----ENCINT.
ENCINT.1ENCINT.000xxxxx000
2
UM10116
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
TRIMInternal oscillator trim register96HRCCLKENCLKTRIM.5TRIM.4TRIM.3TRIM.2TRIM.1TRIM.0
WDCONWatchdog control registerA7HPRE2PRE1PRE0--WDRUNWDTOFWDCLK
WDLWatchdog loadC1HFF11111111
WFEED1Watchdog feed 1C2H
WFEED2Watchdog feed 2C3H
[1] All ports are in input only (high-impedance) state after power-up.
[2] BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is logic 0. If any are written while BRGEN = 1, the result is unpredictable.
[3] The RSTSRC register reflects the cause of the UM10116 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 to 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.
[5] [6]
[4] [6]
P89LPC933/934/935/936 User manual
UM10116
Philips Semiconductors
1.4Memory 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
(1)
(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.
UM10116
P89LPC933/934/935/936 User manual
FFEFh
FF1Fh
FF00h
1FFFh
(1)
1E00h
entry
points
SPECIAL FUNCTION
REGISTERS
(DIRECTLY ADDRESSABLE)
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)
002aab228
(1) ISP code located in Sector 3 for the P89LPC933 device.
Fig 8. P89LPC933/934/935/936 memory map.
1.5Memory organization
The various P89LPC933/934/935/936 memory spaces are as follows:
• DATA
128 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.
• 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
Selected CPU registers and peripheral control and status registers, accessible only
via direct addressing.
• XDATA (P89LPC935/936)
‘External’ Data or Auxiliary RAM. Duplicates the classic 80C51 64 kB memory space
addressed via the MOVX instruction using the SPTR, R0, or R1. All or part of this
space could be implemented on-chip. The P89LPC935/936 has 512 bytes of on-chip
XDATA memory.
64 kB of Code memory space, accessed as part of program execution and via the
MOVC instruction. The UM10116 have 4 KB/8 kB/16 kB of on-chip Code memory.
The P89LPC935/936 also has 512 bytes of on-chip Data EEPROM that is accessed via
SFRs (see Section 18 “
2.Clocks
2.1Enhanced CPU
The P89LPC933/934/935/936 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 P89LPC933/934/935/936 device has several internal clocks as defined below:
UM10116
P89LPC933/934/935/936 User manual
Data EEPROM (P89LPC935/936)”).
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 10
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
2.2.1Oscillator Clock (OSCCLK)
The P89LPC933/934/935/936 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.
CPU Clock (CCLK) modification: DIVM register”). Note: f
CCLK
⁄2.
and
is defined as the
osc
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 MHz, the reset input function of P1.5 must be enabled. An external circuit
is required to hold the device in reset at power-up until VDD has reached its
specified level. When system power is removed V
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
2.3Clock output
The P89LPC933/934/935/936 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
P89LPC933/934/935/936. This output is enabled by the ENCLK bit in the TRIM register
UM10116
P89LPC933/934/935/936 User manual
will fall below the minimum
DD
falls below the minimum specified operating voltage.
DD
The frequency of this clock output is
in Idle mode, it may be turned off prior to entering Idle, saving additional power. Note: on
reset, the TRIM SFR is initialized with a factory preprogrammed value. Therefore when
setting or clearing the ENCLK bit, the user should retain the contents of 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.
1
⁄2 that of the CCLK. If the clock output is not needed
2.4On-chip RC oscillator option
The P89LPC933/934/935/936 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 P89LPC933/934/935/936 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 5:On-chip RC oscillator trim register (TRIM - address 96h) bit allocation
Table 6: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
⁄2 is output on the XTAL2 pin provided the crystal oscillator is not
being used.
fast switching between any clock source and the internal RC oscillator without
needing to go through a reset cycle.
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 power-up until V
specified level. When system power is removed V
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
has reached its
DD
will fall below the minimum
DD
falls below the minimum specified operating voltage.
DD
quartz crystal or
ceramic resonator
P89LPC93x
XTAL1
(1)
XTAL2
002aab22
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
The P89LPC933/934/935/936 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.
RTC
CPU
WDT
32 × PLL
CCU
002aab079
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:
CCLK frequency = f
Where: f
is the frequency of OSCCLK, N is the value of DIVM.
osc
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 P89LPC933/934/935/936 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.
3.A/D converter
3.1
The P89LPC935/936 have two 8-bit, 4-channel multiplexed successive approximation
analog-to-digital converter modules sharing common control logic. The P89LPC933/934
have a single 8-bit, 4-channel multiplexed analog-to-digital converter (ADC1) and an
additional DAC module (DAC0). A block diagram of the A/D converter is shown in
Figure 11
circuit providing an input signal to one of two comparator inputs. The control logic in
combination with the 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.
UM10116
P89LPC933/934/935/936 User manual
. Each A/D consists of a 4-input multiplexer which feeds a sample-and-hold
3.2A/D features
• Two (P89LPC935/936) 8-bit, 4-channel multiplexed input, successive approximation
A/D converters with common control logic (one A/D on the P89LPC933/934).
• Four result registers for each A/D.
• Six operating modes
– Fixed channel, single conversion mode
– Fixed channel, continuous conversion mode
– Auto scan, single conversion mode
– Auto scan, continuous conversion mode
– Dual channel, continuous conversion mode
– Single step mode
• Four conversion start modes
– Timer triggered start
– Start immediately
– Edge triggered
– Dual start immediately (P89LPC935/936)
• 8-bit conversion time of ≥3.9 µs at an A/D clock of 3.3 MHz
• Interrupt or polled operation
• Boundary limits interrupt
• DAC output to a port pin with high output impedance
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 Ta bl e 7
completes. The input channel is selected in the ADINS register. This mode is selected by
setting the SCANx bit in the ADMODA register.
INPUT
MUX
UM10116
P89LPC933/934/935/936 User manual
). An interrupt, if enabled, will be generated after the conversion
comp
+
–
SAR
INPUT
MUX
DAC1
comp
+
–
SAR
8
CONTROL
LOGIC
DAC0
CCLK
Fig 11. ADC block diagram.
Table 7:Input channels and result registers for fixed channel single, auto scan single, and
auto scan continuous conversion modes
Result registerInput channelResult registerInput channel
AD0DAT0AD00AD1DAT0AD10
AD0DAT1AD01AD1DAT1AD11
AD0DAT2AD02AD1DAT2AD12
AD0DAT3AD03AD1DAT3AD13
8
002aab08
3.2.1.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 (see Tab le 8
). An
interrupt, if 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 SCCx bit in the ADMODA register.