NXP P89LPC901 User manual

Category
Water pumps
Type
User manual
INTEGRATED CIRCUITS
Philips
Semiconductors
PHILIPS
2003 Dec 8
P89LPC901/902/903
8-bit microcontrollers with accelerated two-clock 80C51 core
1KB 3V Low-Power byte-eraseable Flash with 128 Byte RAM
USER
MANUAL
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
Table of Contents
2003 Dec 8 2
Table of Contents
1. General Description................................................................................ 7
Pin Configurations ..................................................................................... 7
Product comparison................................................................................... 8
Pin Descriptions - P89LPC901 ................................................................ 12
Pin Descriptions - P89LPC902 ................................................................ 14
Pin Descriptions - P89LPC903 ................................................................ 15
Special Function Registers ...................................................................... 16
Special Function Registers Table - P89LPC901 ..................................... 16
Special Function Registers Table - P89LPC902 ..................................... 19
Special Function Registers Table - P89LPC903 ..................................... 22
Memory Organization .............................................................................. 25
2. Clocks................................................................................................... 27
Enhanced CPU ........................................................................................ 27
Clock Definitions ...................................................................................... 27
CPU Clock (OSCCLK) ............................................................................. 27
Low Speed Oscillator Option - P89LPC901............................................. 27
Medium Speed Oscillator Option - P89LPC901 ...................................... 27
High Speed Oscillator Option - P89LPC901............................................ 27
Oscillator Option Selection- P89LPC901................................................. 28
Clock Output - P89LPC901 ..................................................................... 28
On-Chip RC oscillator Option .................................................................. 28
Watchdog Oscillator Option ..................................................................... 29
External Clock Input Option - P89LPC901 .............................................. 29
CPU Clock (CCLK) Wakeup Delay.......................................................... 32
CPU Clock (CCLK) Modification: DIVM Register..................................... 32
Low Power Select (P89LPC901) ............................................................ 33
3. Interrupts .............................................................................................. 35
Interrupt Priority Structure........................................................................ 35
External Interrupt Inputs .......................................................................... 37
External Interrupt Pin Glitch Suppression................................................ 37
4. I/O Ports ............................................................................................... 39
Port Configurations.................................................................................. 39
Quasi-Bidirectional Output Configuration ................................................ 39
Open Drain Output Configuration ............................................................ 40
Input-Only Configuration.......................................................................... 41
Push-Pull Output Configuration ............................................................... 41
Port 0 Analog Functions .......................................................................... 41
Additional Port Features .......................................................................... 42
5. Timers 0 and 1...................................................................................... 45
Mode 0..................................................................................................... 46
Mode 2..................................................................................................... 46
Mode 3..................................................................................................... 47
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
Table of Contents
2003 Dec 8 3
Mode 6 - P89LPC901 .............................................................................. 47
Timer Overflow toggle output - P89LPC901............................................ 49
6. Real-Time Clock/System Timer............................................................ 51
Real-time Clock Source........................................................................... 51
Changing RTCS1-0 ................................................................................. 53
Real-time Clock Interrupt/Wake Up ......................................................... 53
Reset Sources Affecting the Real-time Clock.......................................... 53
7. Power Monitoring Functions ................................................................. 55
Brownout Detection ................................................................................. 55
Power-On Detection ................................................................................ 56
Power Reduction Modes.......................................................................... 57
8. UART (P89LPC903) ............................................................................. 61
Mode 0..................................................................................................... 61
Mode 1..................................................................................................... 61
Mode 2..................................................................................................... 61
Mode 3..................................................................................................... 61
SFR Space .............................................................................................. 62
Baud Rate Generator and Selection........................................................ 62
Updating the BRGR1 and BRGR0 SFRs................................................. 62
Framing Error........................................................................................... 63
Break Detect............................................................................................ 63
More About UART Mode 0 ...................................................................... 65
More About UART Mode 1 ...................................................................... 66
More About UART Modes 2 and 3........................................................... 67
Framing Error and RI in Modes 2 and 3 with SM2 = 1 ............................ 67
Break Detect............................................................................................ 67
Double Buffering...................................................................................... 68
Double Buffering in Different Modes........................................................ 68
Transmit Interrupts with Double Buffering Enabled (Modes 1, 2 and 3) .. 68
The 9th Bit (Bit 8) in Double Buffering (Modes 1, 2 and 3)...................... 69
Multiprocessor Communications.............................................................. 70
Automatic Address Recognition............................................................... 70
9. Reset .................................................................................................... 73
Power-On reset code execution .............................................................. 73
10. Analog Comparators........................................................................... 75
Comparator Configuration ....................................................................... 75
Internal Reference Voltage ...................................................................... 77
Comparator Interrupt ............................................................................... 77
Comparator and Power Reduction Modes............................................... 78
Comparator Configuration Example ........................................................ 78
11. Keypad Interrupt (KBI)........................................................................ 79
12. Watchdog Timer ................................................................................. 83
Watchdog Function.................................................................................. 83
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
Table of Contents
2003 Dec 8 4
Feed Sequence ....................................................................................... 84
Watchdog Timer in Timer Mode .............................................................. 87
Power down operation ............................................................................. 87
Watchdog Clock Source .......................................................................... 87
Periodic wakeup from Power down without an external oscillator ........... 89
13. Additional Features............................................................................. 91
Software Reset ........................................................................................ 91
Dual Data Pointers................................................................................... 91
14. Flash program memory ...................................................................... 93
General description.................................................................................. 93
Features................................................................................................... 93
Introduction to IAP-Lite ............................................................................ 93
Using Flash as data storage .................................................................... 93
Accessing additional flash elements........................................................ 96
Erase-programming additional flash elements ........................................ 97
Reading additional flash elements........................................................... 97
User Configuration Bytes......................................................................... 99
User Security Bytes ............................................................................... 101
Boot Vector............................................................................................ 102
Boot Status ............................................................................................ 102
15. Instruction set ................................................................................... 103
16. Revision History................................................................................ 107
17. Index................................................................................................. 109
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
List of Figures
2003 Dec 8 5
List of Figures
P89LPC901/902/903 Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Using the Crystal Oscillator - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
On-Chip RC Oscillator TRIM Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Block Diagram of Oscillator Control - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Block Diagram of Oscillator Control - P89LPC902 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Block Diagram of Oscillator Control- P89LPC903. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Interrupt priority level. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Summary of Interrupts - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Summary of Interrupts - P89LPC903 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Summary of Interrupts - P89LPC902 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Interrupt sources, enables, and Power down Wake-up sources - P89LPC901 . . . . . . . . 37
Interrupt sources, enables, and Power down Wake-up sources - P89LPC902 . . . . . . . . 38
Interrupt sources, enables, and Power down Wake-up sources - P89LPC903 . . . . . . . . 38
Number of I/O Pins Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Port Output Configuration Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Quasi-Bidirectional Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Open Drain Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Input Only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Push-Pull Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Port Output Configuration - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Port Output Configuration - P89LPC902 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Port Output Configuration - P89LPC903 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Timer/Counter Mode Control register (TMOD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Timer/Counter Auxiliary Mode Control register (TAMOD). . . . . . . . . . . . . . . . . . . . . . . . . 46
Timer/Counter Control register (TCON) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Timer/Counter 0 or 1 in Mode 0 (13-bit counter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Timer/Counter 0 or 1 in Mode 1 (16-bit counter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Timer/Counter 0 or 1 in Mode 2 (8-bit auto-reload). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Timer/Counter 0 Mode 3 (two 8-bit counters) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Timer/Counter 0 in Mode 6 (PWM auto-reload), P89LPC901. . . . . . . . . . . . . . . . . . . . . . 49
Real-time clock/system timer Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Real-time Clock/System Timer Clock Source - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . 52
:Real-time Clock/System Timer Clock Source - P89LPC902/903 . . . . . . . . . . . . . . . . . . 53
RTCCON Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Brownout Options.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Power Reduction Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Power Control Register (PCON) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Power Control Register (PCONA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
SFR Locations for UARTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Baud Rate Generation for UART. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
BRGCON Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Baud Rate Generations for UART (Modes 1, 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Serial Port Control Register (SCON). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
List of Figures
2003 Dec 8 6
Serial Port Status Register (SSTAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Serial Port Mode 0 (Double Buffering Must Be Disabled) . . . . . . . . . . . . . . . . . . . . . . . . . 66
Serial Port Mode 1 (Only Single Transmit Buffering Case Is Shown) . . . . . . . . . . . . . . . . 66
Serial Port Mode 2 or 3 (Only Single Transmit Buffering Case Is Shown) . . . . . . . . . . . . 67
FE and RI when SM2 = 1 in Modes 2 and 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Transmission with and without Double Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Block Diagram of Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Reset Sources Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Comparator Control Registers (CMP1 and CMP2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Comparator Input and Output Connections - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . 76
Comparator Input and Output Connections - P89LPC902 . . . . . . . . . . . . . . . . . . . . . . . . 76
Comparator Input and Output Connections - P89LPC903 . . . . . . . . . . . . . . . . . . . . . . . . 77
Comparator Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Keypad Pattern Register- P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Keypad Pattern Register - P89LPC902. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Keypad Pattern Register - P89LPC903. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Keypad Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Keypad Interrupt Mask Register (KBM) - P89LPC901 . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Keypad Interrupt Mask Register (KBM)) - P89LPC902. . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Keypad Interrupt Mask Register (KBM)) - P89LPC903. . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Watchdog timer configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Watchdog Prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Watchdog Timer Control Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
P89LPC901/902/903 Watchdog Timeout Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Watchdog Timer in Watchdog Mode (WDTE = 1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Watchdog Timer in Timer Mode (WDTE = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
AUXR1 Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Flash Memory Control Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Assembly language routine to erase/program all or part of a page. . . . . . . . . . . . . . . . . . 95
C-language routine to erase/program all or part of a page . . . . . . . . . . . . . . . . . . . . . . . . 96
Flash elements accesable through IAP-Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Assembly language routine to erase/program a flash element . . . . . . . . . . . . . . . . . . . . . 98
C-language routine to erase/program a flash element . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
C-language routine to read a flash element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Flash User Configuration Byte 1 (UCFG1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
User Sector Security Bytes (SEC0 ... SEC3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Effects of Security Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Boot Vector (BOOTVEC). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Boot Status (BOOTSTAT). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 7
1. GENERAL DESCRIPTION
The P89LPC901/902/903 is a single-chip microcontroller designed for applications demanding high-integration, low cost
solutions over a wide range of performance requirements. The P89LPC901/902/903 is based on a high performance processor
architecture that executes instructions six times the rate of standard 80C51 devices. Many system level functions have been
incorporated into the P89LPC901/902/903 in order to reduce component count, board space, and system cost.
Pin Configurations
8-Pin Packages
CLKOUT/XTAL2/P3.0
1
2
3
4
8
7
6
5
RST
/P1.5
VSS
VDD
XTAL1/P3.1
P1.2/T0
P0.5/CMPREF/KBI5
P0.4/CIN1A/KBI4
P89LPC901
1
2
3
4
8
7
6
5
RST
/P1.5
VSS
VDD
P0.2/CIN2A/KBI2
P0.0/CMP2/KBI0
P0.6/CMP1/KBI6
P0.5/CMPREF/KBI5
P0.4/CIN1A/KBI4
P89LPC902
P1.1/RxD
1
2
3
4
8
7
6
5
RST
/P1.5
VSS
VDD
P0.2/CIN2A/KBI2
P1.0/TXD
P0.5/CMPREF/KBI5
P0.4/CIN1A/KBI4
P89LPC903
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 8
Logic Symbols
Product comparison
The following table highlights differences between these three devices.
Part number
Ext crystal
pins
X2 clkout T0 PWM output CMP1 input CMP2 input
CMP Ref
Input
CMP1 & CMP2
outputs
UART
TxD RxD
P89LPC901 YY Y Y Y
P89LPC902 YYY Y
P89LPC903 YYY YY
V
DD
V
SS
PORT1
PORT0
P89
LPC901
CIN1A
CMPREF
KBI4
KBI5
CLKOUT
XTAL1
RST
XTAL2
PORT3
T0
V
DD
V
SS
PORT1
PORT0
P89
LPC902
CIN1A
CMPREF
CIN2A
CMP2
KBI4
KBI5
KBI6
KBI0
RST
CMP1
KBI2
V
DD
V
SS
PORT1
PORT0
P89
LPC903
CIN1A
CMPREF
KBI4
KBI5
KBI2
RST
CIN2A RxD
TxD
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 9
Block Diagram - P89LPC901
Port 0
Configurable I/Os
128 byte
Data RAM
1KB Code
Flash
Internal Bus
Timer0
Timer1
Keypad
Interrupt
Power Monitor
(Power-On Reset,
Brownout Reset)
Configurable
Oscillator
Crystal or
Resonator
On-Chip
RC
Oscillator
Programmable
Oscillator Divider
CPU
Clock
Port 3
Configurable I/Os
Watchdog Timer
and Oscillator
Analog
Comparator
Real-Time Clock/
System Timer
High Performance
Accelerated 2-clock
80C51 CPU
Port 1
Configurable I/Os
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 10
Block Diagram - P89LPC902
Port 0
Configurable I/Os
128 byte
Data RAM
1KB Code
Flash
Internal Bus
Timer0
Timer1
Keypad
Interrupt
Power Monitor
(Power-On Reset,
Brownout Reset)
On-Chip
RC
Oscillator
Programmable
Oscillator Divider
CPU
Clock
Port 1
Input
Watchdog Timer
and Oscillator
Analog
Comparators
Real-Time Clock/
System Timer
High Performance
Accelerated 2-clock
80C51 CPU
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 11
Block Diagram - P89LPC903
Port 0
Configurable I/Os
128 byte
Data RAM
1KB Code
Flash
Internal Bus
Timer0
Timer1
Keypad
Interrupt
Power Monitor
(Power-On Reset,
Brownout Reset)
On-Chip
RC
Oscillator
Programmable
Oscillator Divider
CPU
Clock
Port 1
Input
Watchdog Timer
and Oscillator
UART
Analog
Comparators
Real-Time Clock/
System Timer
High Performance
Accelerated 2-clock
80C51 CPU
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 12
PIN DESCRIPTIONS - P89LPC901
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.6 6, 7 I/O Port 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet 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.
7I/OP0.4 Port 0 bit 4.
I CIN1A Comparator positive input.
I KBI4 Keyboard Input 4.
6 I/O P0.5 Port 0 bit 5.
I CMPREFComparator reference (negative) input.
I KBI5 Keyboard Input 5.
P1.0 - P1.5 4,5 Port 1: Port 1 is an I/O port with a user-configurable output types.
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 the section on I/O port configuration and the DC
Electrical Characteristics in the Data Sheet for details. P1.5
is input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below.
5I/OP1.2 Port 1 bit 2.
I/O T0 Timer/counter 0 external count input or overflow output.
4IP1.5 Port 1 bit 5. (Input only)
I RST
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-Circuit Programming mode.
P3.0 - P3.1 2, 3 I/O Port 3 Port 3 is an I/O port with a user-configurable output types.
During reset Port 3 latches are configured in the input only
mode with the internal pullup disabled. The operation of
port 3 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet for details.
All pins have Schmitt triggered inputs.
Port 3 also provides various special functions as described below:
3I/OP3.0 Port 3 bit 0.
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 13
O XTAL2 Output from the oscillator amplifier (when a crystal oscillator
option is selected via the FLASH configuration).
OCLKOUTCPU 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.
2I/OP3.1 Port 3 bit 1.
I XTAL1 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
8IGround: 0V reference.
V
DD
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 14
PIN DESCRIPTIONS - P89LPC902
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.6 2,3,5,6,7 I/O Port 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port configuration
and the DC Electrical Characteristics for details.
The Keypad Interrupt feature operates with port 0 pins.
All pins have Schmitt triggered inputs.
Port 0 also provides various special functions as described below.
3I/OP0.0 Port 0 bit 0.
0 CMP2 Comparator 2 output.
I KBI0 Keyboard Input 0.
2I/OP0.2 Port 0 bit 2.
I CIN2A Comparator 2 positive input.
I KBI2 Keyboard Input 2.
7I/OP0.4 Port 0 bit 4.
I CIN1A Comparator 1 positive input.
I KBI4 Keyboard Input 4.
6 I/O P0.5 Port 0 bit 5.
I CMPREFComparator reference (negative) input.
I KBI5 Keyboard Input 5.
5I/OP0.6 Port 0 bit 6.
O CMP1 Comparator 1 output.
I KBI6 Keyboard Input 6.
P1.5 4 I Port 1: Port 1 is a single-bit input-only port. I/O port without a pull-up.
This pin has a Schmitt trigger.
Port 1 also provides the special function described below.
4IP1.5 Port 1 bit 5. (Input only)
I RST
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.
V
SS
8IGround: 0V reference.
V
DD
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 15
PIN DESCRIPTIONS - P89LPC903
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
P0.0 - P0.6 2,6,7 I/O Port 0: Port 0 is an I/O port with a user-configurable output types.
During reset Port 0 latches are configured in the input only
mode with the internal pullup disabled. The operation of port
0 pins as inputs and outputs depends upon the port
configuration selected. Each port pin is configured
independently. Refer to the section on I/O port
configuration and the DC Electrical Characteristics in the
Data Sheet 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.
2I/OP0.2 Port 0 bit 2.
I CIN2A Comparator 2 positive input.
I KBI2 Keyboard Input 2.
7I/OP0.4 Port 0 bit 4.
I CIN1A Comparator 1 positive input.
I KBI4 Keyboard Input 4.
6 I/O P0.5 Port 0 bit 5.
I CMPREFComparator reference (negative) input.
I KBI5 Keyboard Input 5.
P1.0 - P1.5 3,4,5 Port 1: Port 1 is an I/O port with a user-configurable output types.
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 the section on I/O port configuration and the DC
Electrical Characteristics in the Data Sheet for details. P1.5
is input only.
All pins have Schmitt triggered inputs.
Port 1 also provides various special functions as described below.
5I/OP1.0 Port 1 bit 0.
O TxD Serial port transmitter data.
3I/OP1.1 Port 1 bit 1.
I RxD Serial port receiver data.
4IP1.5 Port 1 bit 5. (Input only)
I RST
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-Circuit Programming mode.
V
SS
8IGround: 0V reference.
V
DD
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 16
SPECIAL FUNCTION REGISTERS
Note: Special Function Registers (SFRs) accesses are restricted in the following ways:
1. User must NOT attempt to access any SFR locations not defined.
2. Accesses to any defined SFR locations must be strictly for the functions for the SFRs.
3. SFR bits labeled ’-’, ’0’ or ’1’ can ONLY be written and read as follows:
- ’-’ Unless otherwise specified, MUST be written with ’0’, but can return any value when read (even if it was written with ’0’).
It is a reserved bit and may be used in future derivatives.
- ’0’ MUST be written with ’0’, and will return a ’0’ when read.
- ’1’ MUST be written with ’1’, and will return a ’1’ when read.
Special Function Registers Table - P89LPC901
Name Description
SFR
Address
Bit Functions and Addresses Reset Value
MSB
LSB
Hex Binary
E7 E6 E5 E4 E3 E2 E1 E0
ACC* Accumulator E0H 00H 00000000
AUXR1# Auxiliary Function Register A2H CLKLP - - ENT0 SRST 0 - DPS 00H
1
000000x0
F7 F6 F5 F4 F3 F2 F1 F0
B* B Register F0H 00H 00000000
CMP1# Comparator 1 Control Register ACH - - CE1 - CN1 - CO1 CMF1 00H
1
xx000000
DIVM# CPU Clock Divide-by-M Control 95H 00H 00000000
DPTR Data Pointer (2 bytes)
DPH Data Pointer High 83H 00H 00000000
DPL Data Pointer Low 82H 00H 00000000
FMADRH# Program Flash Address High E7H 00H 00000000
FMADRL# Program Flash Address Low E6H 00H 00000000
FMCON#
Program Flash Control (Read)
E4H
BUSY - - - HVA HVE SV OI 70H 01110000
Program Flash Control (Write)
FMCMD.
7
FMCMD.
6
FMCMD.
5
FMCMD.
4
FMCMD.
3
FMCMD.
2
FMCMD.
1
FMCMD.
0
FMDATA# Program Flash Data E5H 00H 00000000
AF AE AD AC AB AA A9 A8
IEN0* Interrupt Enable 0 A8H EA EWDRT EBO - ET1 - ET0 - 00H 00000000
EF EE ED EC EB EA E9 E8
IEN1*# Interrupt Enable 1 E8H - - - - - EC EKBI - 00H
1
00x00000
BF BE BD BC BB BA B9 B8
IP0* Interrupt Priority 0 B8H - PWDRT PBO - PT1 - PT0 - 00H
1
x0000000
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 17
IP0H# Interrupt Priority 0 High B7H -
PWDRT
H
PBOH - PT1H - PT0H - 00H
1
x0000000
FF FE FD FC FB FA F9 F8
IP1*# Interrupt Priority 1 F8H - - - - - PC PKBI - 00H
1
00x00000
IP1H# Interrupt Priority 1 High F7H - - - - - PCH PKBIH - 00H
1
00x00000
KBCON# Keypad Control Register 94H - - - - - -
PATN_S
EL
KBIF 00H
1
xxxxxx00
KBMASK# Keypad Interrupt Mask Register 86H 00H 00000000
KBPATN# Keypad Pattern Register 93H FFH 11111111
87 86 85 84 83 82 81 80
P0* Port 0 80H - -
CMPREF/
KB5
CIN1A/
KB4
---- Note 1
97 96 95 94 93 92 91 90
P1* Port 1 90H - - RST
--T0- -
B7 B6 B5 B4 B3 B2 B1 B0
P3* Port 3 B0H - - - - - - XTAL1 XTAL2 Note 1
P0M1# Port 0 Output Mode 1 84H - - (P0M1.5) (P0M1.4) - - - - FFH 11111111
P0M2# Port 0 Output Mode 2 85H - - (P0M2.5) (P0M2.4) - - - - 00H 00000000
P1M1# Port 1 Output Mode 1 91H - - (P1M1.5) - - (P1M1.2) - - FFH
1
11111111
P1M2# Port 1 Output Mode 2 92H - - (P1M2.5) - - (P1M2.2) - - 00H
1
00000000
P3M1# Port 3 Output Mode 1 B1H - - - - - - (P3M1.1) (P3M1.0) 03H
1
xxxxxx11
P3M2# Port 3 Output Mode 2 B2H - - - - - - (P3M2.1) (P3M2.0) 00H
1
xxxxxx00
PCON# Power Control Register 87H - - BOPD BOI GF1 GF0 PMOD1 PMOD0 00H 00000000
PCONA# Power Control Register A B5H RTCPD - VCPD - - - - -
00H
1
00000000
D7 D6 D5 D4 D3 D2 D1 D0
PSW* Program Status Word D0H CY AC F0 RS1 RS0 OV F1 P 00H 00000000
PT0AD# Port 0 Digital Input Disable F6H - - PT0AD.5 PT0AD.4 - - - - 00H xx00000x
RSTSRC# Reset Source Register DFH - - BOF POF - R_WD R_SF R_EX Note 2
RTCCON# Real-Time Clock Control D1H RTCF RTCS1 RTCS0 - - - ERTC RTCEN 60H
1,5
011xxx00
RTCH# Real-Time Clock Register High D2H 00H
5
00000000
RTCL# Real-Time Clock Register Low D3H 00H
5
00000000
SP Stack Pointer 81H 07H 00000111
TAMOD# Timer 0 Auxiliary Mode 8FH - - - - - - - T0M2 00H xxx0xxx0
Name Description
SFR
Address
Bit Functions and Addresses Reset Value
MSB
LSB
Hex Binary
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 18
8F 8E 8D 8C 8B 8A 89 88
TCON* Timer 0 and 1 Control 88H TF1 TR1 TF0 TR0 - - - - 00H 00000000
TH0 Timer 0 High 8CH 00H 00000000
TH1 Timer 1 High 8DH 00H 00000000
TL0 Timer 0 Low 8AH 00H 00000000
TL1 Timer 1 Low 8BH 00H 00000000
TMOD Timer 0 and 1 Mode 89H - - T1M1 T1M0 - T0C\T T0M1 T0M0 00H 00000000
TRIM# Internal Oscillator Trim Register 96H - ENCLK TRIM.5 TRIM.4 TRIM.3 TRIM.2 TRIM.1 TRIM.0 Notes 4,5
WDCON# Watchdog Control Register A7H PRE2 PRE1 PRE0 - - WDRUN WDTOF WDCLK Notes 3,5
WDL# Watchdog Load C1H FFH 11111111
WFEED1# Watchdog Feed 1 C2H
WFEED2# Watchdog Feed 2 C3H
Name Description
SFR
Address
Bit Functions and Addresses Reset Value
MSB
LSB
Hex Binary
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 19
Special Function Registers Table - P89LPC902
Name Description
SFR
Address
Bit Functions and Addresses Reset Value
MSB
LSB
Hex Binary
E7 E6 E5 E4 E3 E2 E1 E0
ACC* Accumulator E0H 00H 00000000
AUXR1# Auxiliary Function Register A2H ----SRST0-DPS00H
1
000000x0
F7 F6 F5 F4 F3 F2 F1 F0
B* B Register F0H 00H 00000000
CMP1# Comparator 1 Control Register ACH - - CE1 - CN1 OE1 CO1 CMF1 00H
1
xx000000
CMP2# Comparator 2 Control Register ADH - - CE2 - CN2 OE2 CO2 CMF2 00H
1
xx000000
DIVM# CPU Clock Divide-by-M Control 95H 00H 00000000
DPTR Data Pointer (2 bytes)
DPH Data Pointer High 83H 00H 00000000
DPL Data Pointer Low 82H 00H 00000000
FMADRH# Program Flash Address High E7H 00H 00000000
FMADRL# Program Flash Address Low E6H 00H 00000000
FMCON#
Program Flash Control (Read)
E4H
BUSY - - - HVA HVE SV OI 70H 01110000
Program Flash Control (Write)
FMCMD.
7
FMCMD.
6
FMCMD.
5
FMCMD.
4
FMCMD.
3
FMCMD.
2
FMCMD.
1
FMCMD.
0
FMDATA# Program Flash Data E5H 00H 00000000
AF AE AD AC AB AA A9 A8
IEN0* Interrupt Enable 0 A8H EA EWDRT EBO - ET1 - ET0 - 00H 00000000
EF EE ED EC EB EA E9 E8
IEN1*# Interrupt Enable 1 E8H -----ECEKBI-00H
1
00x00000
BF BE BD BC BB BA B9 B8
IP0* Interrupt Priority 0 B8H - PWDRT PBO - PT1 - PT0 - 00H
1
x0000000
IP0H# Interrupt Priority 0 High B7H -
PWDRT
H
PBOH - PT1H - PT0H - 00H
1
x0000000
FF FE FD FC FB FA F9 F8
IP1*#Interrupt Priority 1 F8H-----PCPKBI-00H
1
00x00000
IP1H#Interrupt Priority 1 High F7H-----PCHPKBIH-00H
1
00x00000
KBCON#Keypad Control Register 94H------
PATN_S
EL
KBIF 00H
1
xxxxxx00
KBMASK# Keypad Interrupt Mask Register 86H 00H 00000000
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
GENERAL DESCRIPTION
2003 Dec 8 20
KBPATN# Keypad Pattern Register 93H FFH 11111111
87 86 85 84 83 82 81 80
P0* Port 0 80H -
CMP1/
KB6
CMPREF/
KB5
CIN1A/
KB4
-KB2-KB0 Note 1
97 96 95 94 93 92 91 90
P1* Port 1 90H - - RST
-----
B7 B6 B5 B4 B3 B2 B1 B0
P0M1# Port 0 Output Mode 1 84H - (P0M1.6) (P0M1.5) (P0M1.4) - (P0M1.2) - (P0M1.0) FFH 11111111
P0M2# Port 0 Output Mode 2 85H - (P0M2.6) (P0M2.5) (P0M2.4) - (P0M2.2) - (P0M2.0) 00H 00000000
P1M1#Port 1 Output Mode 1 91H--(P1M1.5)-----FFH
1
11111111
P1M2#Port 1 Output Mode 2 92H--(P1M2.5)-----00H
1
00000000
PCON# Power Control Register 87H - - BOPD BOI GF1 GF0 PMOD1 PMOD0 00H 00000000
PCONA#Power Control Register A B5HRTCPD-VCPD-----
00H
1
00000000
D7 D6 D5 D4 D3 D2 D1 D0
PSW* Program Status Word D0H CY AC F0 RS1 RS0 OV F1 P 00H 00000000
PT0AD# Port 0 Digital Input Disable F6H - - PT0AD.5 PT0AD.4 - PT0AD.2 - - 00H xx00000x
RSTSRC# Reset Source Register DFH - - BOF POF - R_WD R_SF R_EX Note 2
RTCCON# Real-Time Clock Control D1H RTCF RTCS1 RTCS0 - - - ERTC RTCEN 60H
1,5
011xxx00
RTCH# Real-Time Clock Register High D2H 00H
5
00000000
RTCL# Real-Time Clock Register Low D3H 00H
5
00000000
SP Stack Pointer 81H 07H 00000111
8F 8E 8D 8C 8B 8A 89 88
TCON*Timer 0 and 1 Control 88HTF1TR1TF0TR0----00H00000000
TH0 Timer 0 High 8CH 00H 00000000
TH1 Timer 1 High 8DH 00H 00000000
TL0 Timer 0 Low 8AH 00H 00000000
TL1 Timer 1 Low 8BH 00H 00000000
TMOD Timer 0 and 1 Mode 89H - - T1M1 T1M0 - - T0M1 T0M0 00H 00000000
TRIM# Internal Oscillator Trim Register 96H - - TRIM.5 TRIM.4 TRIM.3 TRIM.2 TRIM.1 TRIM.0 Notes 4,5
Name Description
SFR
Address
Bit Functions and Addresses Reset Value
MSB
LSB
Hex Binary
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114

NXP P89LPC901 User manual

Category
Water pumps
Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI