Philips P89LPC901, P89LPC902, P89LPC903 User Manual

INTEGRATED CIRCUITS
P89LPC901/902/903
8-bit microcontrollers with accelerated two-clock 80C51 core 1KB 3V Low-Power byte-eraseable Flash with 128 Byte RAM
Philips Semiconductors
PHILIPS
2003 Dec 8
Philips Semiconductors
User’s Manual - Preliminary -
Table of Contents
P89LPC901/902/903
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
2003 Dec 8 2
Philips Semiconductors
User’s Manual - Preliminary -
Table of Contents
Mode 6 - P89LPC901 .............................................................................. 47
Timer Overflow toggle output - P89LPC901............................................ 49
P89LPC901/902/903
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
2003 Dec 8 3
Philips Semiconductors
User’s Manual - Preliminary -
Table of Contents
P89LPC901/902/903
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
2003 Dec 8 4
Philips Semiconductors
User’s Manual - Preliminary -
List of Figures
P89LPC901/902/903
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
2003 Dec 8 5
Philips Semiconductors
User’s Manual - Preliminary -
List of Figures
P89LPC901/902/903
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
2003 Dec 8 6
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
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
P89LPC901
VDD
XTAL1/P3.1
CLKOUT/XTAL2/P3.0
/P1.5
RST
VDD
P0.2/CIN2A/KBI2
P0.0/CMP2/KBI0
/P1.5
RST
1
2
3
4
P89LPC902
1
2
3
4
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P1.2/T0
5
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P0.6/CMP1/KBI6
5
VDD
P0.2/CIN2A/KBI2
P1.1/RxD
/P1.5
RST
P89LPC903
1
2
3
4
VSS
8
P0.4/CIN1A/KBI4
7
P0.5/CMPREF/KBI5
6
P1.0/TXD
5
2003 Dec 8 7
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Logic Symbols
KBI4 KBI5
CLKOUT
KBI4 KBI5 KBI6 KBI2 KBI0
CIN1A
CMPREF
XTAL2
XTAL1
CIN1A
CMPREF
CMP1
CIN2A
CMP2
PORT0
PORT3
PORT0
VDDV
SS
P89
LPC901
VDDV
SS
P89
LPC902
P89LPC901/902/903
RST
PORT1
PORT1
T0
RST
VDDV
SS
KBI4 KBI5 KBI2
CIN1A
CMPREF
CIN2A RxD
PORT0
P89
LPC903
PORT1
RST
TxD
Product comparison
The following table highlights differences between these three devices.
Part number
P89LPC901 YY Y Y Y
P89LPC902 YYY Y
P89LPC903 YYY YY
Ext crystal
pins
X2 clkout T0 PWM output CMP1 input CMP2 input
CMP Ref
Input
CMP1 & CMP2
outputs
UART
TxD RxD
2003 Dec 8 8
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC901
High Performance
Accelerated 2-clock
1KB Code
Flash
Port 3
Configurable I/Os
Port 1
Configurable I/Os
Port 0
Configurable I/Os
80C51 CPU
Internal Bus
P89LPC901/902/903
128 byte
Data RAM
Timer0 Timer1
Real-Time Clock/
System Timer
Crystal or
Resonator
Keypad
Interrupt
Watchdog Timer
and Oscillator
Programmable
Oscillator Divider
Configurable
Oscillator
CPU
Clock
On-Chip
RC
Oscillator
Analog
Comparator
Power Monitor
(Power-On Reset,
Brownout Reset)
2003 Dec 8 9
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC902
Accelerated 2-clock
1KB Code
Flash
Port 1
Input
Port 0
Configurable I/Os
High Performance
80C51 CPU
Internal Bus
Real-Time Clock/
System Timer
P89LPC901/902/903
128 byte
Data RAM
Timer0 Timer1
Keypad
Interrupt
Watchdog Timer
and Oscillator
Programmable
Oscillator Divider
On-Chip
RC
Oscillator
Analog
Comparators
CPU
Clock
Power Monitor
(Power-On Reset,
Brownout Reset)
2003 Dec 8 10
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Block Diagram - P89LPC903
High Performance
Accelerated 2-clock
1KB Code
Flash
Port 1
Input
Port 0
Configurable I/Os
Keypad
Interrupt
Watchdog Timer
and Oscillator
P89LPC901/902/903
80C51 CPU
128 byte
Data RAM
Internal Bus
UART
Timer0 Timer1
Real-Time Clock/
System Timer
Analog
Comparators
Programmable
Oscillator Divider
On-Chip
RC
Oscillator
2003 Dec 8 11
CPU
Clock
Power Monitor
(Power-On Reset,
Brownout Reset)
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
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
P3.0 - P3.1 2, 3 I/O Port 3 Port 3 is an I/O port with a user-configurable output types.
All pins have Schmitt triggered inputs.
Port 3 also provides various special functions as described below:
3I/OP3.0 Port 3 bit 0.
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.
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.
2003 Dec 8 12
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
MNEMONIC PIN NO. TYPE NAME AND FUNCTION
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
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
P89LPC901/902/903
2003 Dec 8 13
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
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
V
SS
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
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.
2003 Dec 8 14
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
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
V
SS
V
DD
8IGround: 0V reference.
1IPower Supply: This is the power supply voltage for normal operation as
well as Idle and Power down modes.
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.
2003 Dec 8 15
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
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
ACC* Accumulator E0H 00H 00000000
AUXR1# Auxiliary Function Register A2H CLKLP - - ENT0 SRST 0 - DPS 00H
SFR
Address
MSB
E7 E6 E5 E4 E3 E2 E1 E0
Bit Functions and Addresses Reset Value
LSB
Hex Binary
1
000000x0
F7 F6 F5 F4 F3 F2 F1 F0
B* B Register F0H 00H 00000000
1
CMP1# Comparator 1 Control Register ACH - - CE1 - CN1 - CO1 CMF1 00H
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
Program Flash Control (Read)
FMCON#
FMDATA# Program Flash Data E5H 00H 00000000
IEN0* Interrupt Enable 0 A8H EA EWDRT EBO - ET1 - ET0 - 00H 00000000
IEN1*# Interrupt Enable 1 E8H - - - - - EC EKBI - 00H
Program Flash Control (Write)
BUSY - - - HVA HVE SV OI 70H 01110000
E4H
FMCMD.7FMCMD.6FMCMD.5FMCMD.4FMCMD.3FMCMD.2FMCMD.1FMCMD.
AF AE AD AC AB AA A9 A8
EF EE ED EC EB EA E9 E8
0
xx000000
1
00x00000
BF BE BD BC BB BA B9 B8
IP0* Interrupt Priority 0 B8H - PWDRT PBO - PT1 - PT0 - 00H
2003 Dec 8 16
1
x0000000
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
IP0H# Interrupt Priority 0 High B7H -
IP1*# Interrupt Priority 1 F8H - - - - - PC PKBI - 00H
IP1H# Interrupt Priority 1 High F7H - - - - - PCH PKBIH - 00H
KBCON# Keypad Control Register 94H - - - - - -
KBMASK# Keypad Interrupt Mask Register 86H 00H 00000000
KBPATN# Keypad Pattern Register 93H FFH 11111111
P0* Port 0 80H - -
P1* Port 1 90H - - RST
P3* Port 3 B0H - - - - - - XTAL1 XTAL2 Note 1
SFR
Address
MSB
PWDRT
H
FF FE FD FC FB FA F9 F8
87 86 85 84 83 82 81 80
97 96 95 94 93 92 91 90
B7 B6 B5 B4 B3 B2 B1 B0
Bit Functions and Addresses Reset Value
PBOH - PT1H - PT0H - 00H1x0000000
CMPREF/
KB5
CIN1A/
KB4
--T0- -
---- Note 1
P89LPC901/902/903
LSB
Hex Binary
1
00x00000
1
00x00000
PATN_S
EL
KBIF 00H
1
xxxxxx00
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
1
00H
1
1
1
1
1,5
5
5
11111111
00000000
xxxxxx11
xxxxxx00
00000000
011xxx00
00000000
00000000
P1M1# Port 1 Output Mode 1 91H - - (P1M1.5) - - (P1M1.2) - - FFH
P1M2# Port 1 Output Mode 2 92H - - (P1M2.5) - - (P1M2.2) - - 00H
P3M1# Port 3 Output Mode 1 B1H - - - - - - (P3M1.1) (P3M1.0) 03H
P3M2# Port 3 Output Mode 2 B2H - - - - - - (P3M2.1) (P3M2.0) 00H
PCON# Power Control Register 87H - - BOPD BOI GF1 GF0 PMOD1 PMOD0 00H 00000000
PCONA# Power Control Register A B5H RTCPD - VCPD - - - - -
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
RTCH# Real-Time Clock Register High D2H 00H
RTCL# Real-Time Clock Register Low D3H 00H
SP Stack Pointer 81H 07H 00000111
TAMOD# Timer 0 Auxiliary Mode 8FH - - - - - - - T0M2 00H xxx0xxx0
2003 Dec 8 17
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
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
SFR
Address
MSB
8F 8E 8D 8C 8B 8A 89 88
Bit Functions and Addresses Reset Value
P89LPC901/902/903
LSB
Hex Binary
2003 Dec 8 18
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
Special Function Registers Table - P89LPC902
Name Description
ACC* Accumulator E0H 00H 00000000
AUXR1# Auxiliary Function Register A2H ----SRST0-DPS00H
B* B Register F0H 00H 00000000
CMP1# Comparator 1 Control Register ACH - - CE1 - CN1 OE1 CO1 CMF1 00H
CMP2# Comparator 2 Control Register ADH - - CE2 - CN2 OE2 CO2 CMF2 00H
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
SFR
Address
MSB
E7 E6 E5 E4 E3 E2 E1 E0
F7 F6 F5 F4 F3 F2 F1 F0
Bit Functions and Addresses Reset Value
LSB
Hex Binary
1
000000x0
1
xx000000
1
xx000000
FMADRH# Program Flash Address High E7H 00H 00000000
FMADRL# Program Flash Address Low E6H 00H 00000000
Program Flash Control (Read)
FMCON#
FMDATA# Program Flash Data E5H 00H 00000000
IEN0* Interrupt Enable 0 A8H EA EWDRT EBO - ET1 - ET0 - 00H 00000000
IEN1*# Interrupt Enable 1 E8H -----ECEKBI-00H
IP0* Interrupt Priority 0 B8H - PWDRT PBO - PT1 - PT0 - 00H
IP0H# Interrupt Priority 0 High B7H -
IP1*#Interrupt Priority 1 F8H-----PCPKBI-00H
IP1H#Interrupt Priority 1 High F7H-----PCHPKBIH-00H
KBCON#Keypad Control Register 94H------
KBMASK# Keypad Interrupt Mask Register 86H 00H 00000000
Program Flash Control (Write)
BUSY - - - HVA HVE SV OI 70H 01110000
E4H
FMCMD.7FMCMD.6FMCMD.5FMCMD.4FMCMD.3FMCMD.2FMCMD.1FMCMD.
AF AE AD AC AB AA A9 A8
EF EE ED EC EB EA E9 E8
BF BE BD BC BB BA B9 B8
PWDRT
FF FE FD FC FB FA F9 F8
PBOH - PT1H - PT0H - 00H
H
PATN_S
EL
0
KBIF 00H
1
00x00000
1
x0000000
1
x0000000
1
00x00000
1
00x00000
1
xxxxxx00
2003 Dec 8 19
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
KBPATN# Keypad Pattern Register 93H FFH 11111111
P0* Port 0 80H -
P1* Port 1 90H - - RST
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
P1M2#Port 1 Output Mode 2 92H--(P1M2.5)-----00H
PCON# Power Control Register 87H - - BOPD BOI GF1 GF0 PMOD1 PMOD0 00H 00000000
PCONA#Power Control Register A B5HRTCPD-VCPD-----
SFR
Address
MSB
87 86 85 84 83 82 81 80
CMP1/
KB6
97 96 95 94 93 92 91 90
B7 B6 B5 B4 B3 B2 B1 B0
Bit Functions and Addresses Reset Value
CMPREF/
KB5
CIN1A/
KB4
-----
-KB2-KB0 Note 1
P89LPC901/902/903
LSB
Hex Binary
1
11111111
1
00000000
1
00000000
00H
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
1,5
RTCCON# Real-Time Clock Control D1H RTCF RTCS1 RTCS0 - - - ERTC RTCEN 60H
RTCH# Real-Time Clock Register High D2H 00H
RTCL# Real-Time Clock Register Low D3H 00H
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
011xxx00
5
00000000
5
00000000
2003 Dec 8 20
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
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
SFR
Address
MSB
Bit Functions and Addresses Reset Value
P89LPC901/902/903
LSB
Hex Binary
2003 Dec 8 21
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
Special Function Registers Table - P89LPC903
Name Description
ACC* Accumulator E0H 00H 00000000
AUXR1# Auxiliary Function Register A2H - EBRR - - SRST 0 - DPS 00H
B* B Register F0H 00H 00000000
BRGR0#§ Baud Rate Generator Rate Low BEH 00H 00000000
BRGR1#§ Baud Rate Generator Rate High BFH 00H 00000000
BRGCON# Baud Rate Generator Control BDH - - - - - - SBRGS BRGEN 00H
CMP1# Comparator 1 Control Register ACH - - CE1 - CN1 - CO1 CMF1 00H
CMP2# Comparator 2 Control Register ADH - - CE2 - CN2 - CO2 CMF2 00H
SFR
Address
MSB
E7 E6 E5 E4 E3 E2 E1 E0
F7 F6 F5 F4 F3 F2 F1 F0
Bit Functions and Addresses Reset Value
LSB
Hex Binary
1
000000x0
%
xxxxxx00
1
xx000000
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
Program Flash Control (Read)
FMCON#
FMDATA# Program Flash Data E5H 00H 00000000
IEN0* Interrupt Enable 0 A8H EA EWDRT EBO ES/ESR ET1 - ET0 - 00H 00000000
IEN1*# Interrupt Enable 1 E8H - EST - - - EC EKBI - 00H
IP0* Interrupt Priority 0 B8H - PWDRT PBO PS/PSR PT1 - PT0 - 00H
IP0H# Interrupt Priority 0 High B7H -
IP1*# Interrupt Priority 1 F8H - PST - - - PC PKBI - 00H
Program Flash Control (Write)
BUSY - - - HVA HVE SV OI 70H 01110000
E4H
FMCMD.7FMCMD.6FMCMD.5FMCMD.4FMCMD.3FMCMD.2FMCMD.1FMCMD.
AF AE AD AC AB AA A9 A8
EF EE ED EC EB EA E9 E8
BF BE BD BC BB BA B9 B8
PWDRT
FF FE FD FC FB FA F9 F8
PBOH
H
PSH/
PSRH
PT1H - PT0H - 00H
0
1
00x00000
1
x0000000
1
x0000000
1
00x00000
2003 Dec 8 22
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
IP1H# Interrupt Priority 1 High F7H - PSTH - - - PCH PKBIH - 00H100x00000
KBCON# Keypad Control Register 94H - - - - - -
KBMASK# Keypad Interrupt Mask Register 86H 00H 00000000
KBPATN# Keypad Pattern Register 93H FFH 11111111
P0* Port 0 80H - -
P1* Port 1 90H - - RST
P0M1# Port 0 Output Mode 1 84H - - (P0M1.5) (P0M1.4) - (P0M1.2) - - FFH 11111111
P0M2# Port 0 Output Mode 2 85H - - (P0M2.5) (P0M2.4) - (P0M2.2) - - 00H 00000000
P1M1# Port 1 Output Mode 1 91H - - (P1M1.5) - - - (P1M1.1) (P1M1.0) FFH
P1M2# Port 1 Output Mode 2 92H - - (P1M2.5) - - - (P1M2.1) (P1M2.0) 00H
SFR
Address
MSB
87 86 85 84 83 82 81 80
97 96 95 94 93 92 91 90
Bit Functions and Addresses Reset Value
CMPREF/
KB5
CIN1A/
KB4
- - - RxD TxD
-KB2- - Note 1
P89LPC901/902/903
LSB
Hex Binary
PATN_S
EL
KBIF 00H
1
xxxxxx00
1
11111111
1
00000000
PCON# Power Control Register 87H SMOD1 SMOD0 BOPD BOI GF1 GF0 PMOD1 PMOD0 00H 00000000
1
PCONA# Power Control Register A B5H RTCPD - VCPD - - - SPD -
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_BK R_WD R_SF R_EX Note 2
RTCCON# Real-Time Clock Control D1H RTCF RTCS1 RTCS0 - - - ERTC RTCEN 60H
RTCH# Real-Time Clock Register High D2H 00H
RTCL# Real-Time Clock Register Low D3H 00H
SADDR# Serial Port Address Register A9H 00H 00000000
SADEN# Serial Port Address Enable B9H 00H 00000000
SBUF Serial Port Data Buffer Register 99H xxH xxxxxxxx
9F 9E 9D 9C 9B 9A 99 98
SCON* Serial Port Control 98H SM0/FE SM1 SM2 REN TB8 RB8 TI RI 00H 00000000
SSTAT# Serial Port Extended Status Register BAH DBMOD INTLO CIDIS DBISEL FE BR OE STINT 00H 00000000
00H
1,5
5
5
00000000
011xxx00
00000000
00000000
SP Stack Pointer 81H 07H 00000111
8F 8E 8D 8C 8B 8A 89 88
TCON*Timer 0 and 1 Control 88HTF1TR1TF0TR0----00H00000000
2003 Dec 8 23
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Name Description
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
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
SFR
Address
MSB
Bit Functions and Addresses Reset Value
P89LPC901/902/903
LSB
Hex Binary
Notes:
* SFRs are bit addressable. # SFRs are modified from or added to the 80C51 SFRs.
- Reserved bits, must be written with 0’s.
§ BRGR1 and BRGR0 must only be written if BRGEN in BRGCON SFR is ’0’. If any of them is written if BRGEN = 1, result is unpredictable.
Unimplemented bits in SFRs (labeled ’-’ ) are X (unknown) at all times. Unless otherwise specified, ones should not be written to
these bits since they may be used for other purposes in future derivatives. The reset values shown for these bits are ’0’s although they are unknown when read.
1. All ports are in input only (high impendance) state after power-up.
2. The RSTSRC register reflects the cause of the P89LPC901/902/903 reset. Upon a power-up reset, all reset source flags are cleared except POF and BOF - the power-on reset value is xx110000.
3. After reset, the value is 111001x1, i.e., PRE2-PRE0 are all 1, WDRUN=1 and WDCLK=1. WDTOF bit is 1 after watchdog reset and is 0 after power-on reset. Other resets will not affect WDTOF.
4. On power-on reset, the TRIM SFR is initialized with a factory preprogrammed value. Other resets will not cause initialization of the TRIM register.
5. The only reset source that affects these SFRs is power-on reset.
2003 Dec 8 24
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
Memory Organization
The P89LPC901/902/903 memory map is shown in Figure 1-1.
03FFh
Sector 3
0300h 02FFh
Sector 2
0200h 01FFh
Sector 1
0100h
00FFh
Sector 0
0000h
1 KB Flash Code
Memory Space
Special Function
Registers
(directly addressable)
DATA
128 Bytes On-Chip
Data Memory (stack,
direct and indir. addr.)
4 Reg. Banks R0-R7
Data Memory
(DATA, IDATA)
P89LPC901/902/903
FFh
80h 7Fh
00h
Figure 1-1: P89LPC901/902/903 Memory Map
The various P89LPC901/902/903 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.
SFR Special Function Registers. Selected CPU registers and peripheral control and status registers, accessible only via
direct addressing.
CODE 1KB of Code memory accessed as part of program execution and via the MOVC instruction.
2003 Dec 8 25
Philips Semiconductors
User’s Manual - Preliminary -
GENERAL DESCRIPTION
P89LPC901/902/903
2003 Dec 8 26
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
P89LPC901/902/903
2. CLOCKS
Enhanced CPU
The P89LPC901/902/903 uses an enhanced 80C51 CPU which runs at 6 times the speed of standard 80C51 devices. A machine cycle consists of two CPU clock cycles, and most instructions execute in one or two machine cycles.
Clock Definitions
The P89LPC901/902/903 device has several internal clocks as defined below:
• OSCCLK - Input to the DIVM clock divider. OSCCLK is selected from one of the clock sources (see Figure 2-3,Figure 2-
4,Figure 2-5) and can also be optionally divided to a slower frequency (see section "CPU Clock (CCLK) Modification: DIVM Register"). Note: f
• XCLK - Output of the crystal oscillator (P89LPC901)
• CCLK - CPU clock.
• PCLK - Clock for the various peripheral devices and is CCLK/2
CPU Clock (OSCCLK)
is defined as the OSCCLK frequency.
OSC
The P89LPC901 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.
The P89LPC902 and P89LPC903 devices allow the user to select between an on-chip watchdog oscillator and an on-chip RC oscillator as the CPU clock source.
Low Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 20 kHz to 100 kHz. Ceramic resonators are also supported in this configuration.
Medium Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 100 kHz to 4 MHz. Ceramic resonators are also supported in this configuration.
High Speed Oscillator Option - P89LPC901
This option supports an external crystal in the range of 4MHz to 12 MHz. Ceramic resonators are also supported in this configuration. If CCLK is 8MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to ’1’ to reduce power consumption. On reset, CLKLP is ’0’ allowing highest performance access. This bit can then be set in software if CCLK is running at 8MHz or slower.
2003 Dec 8 27
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
Quartz crystal or
ceramic resonator
The oscillator must be configured in one of the following modes:
- Low Frequency Crystal
- Medium Frequency Crystal
- High Frequency Crystal
*
* A series resistor may be required to limit crystal drive levels. This is especially important for low frequency crystals.
Figure 2-1: Using the Crystal Oscillator - P89LPC901
P89LPC901/902/903
P89LPC901
XTAL1
XTAL2
Oscillator Option Selection- P89LPC901
The oscillator option is selectable either by the FOSC2:0 bits in UCFG1 or by the RTCS1:0 bits in RTCCON. If the FOSC2:0 bits select an OSCCLK source of either the internal RC oscillator or the WDT oscillator, then the RTCS1:0 bits will select the oscillator option for the crystal oscillator. Otherwise, the crystal oscillator option is selected by FOSC2:0. See Table 6-1 and Table 6-2.
Clock Output - P89LPC901
The P89LPC901 supports a user selectable clock output function on the XTAL2 / CLKOUT pin when no crystal oscillator is being used. This condition occurs if another 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 P89LPC901. 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 bits 5:0 of the TRIM register. This can be done by reading the contents of the TRIM register (into the ACC for example), modifying bit 6, and writing this result back into the TRIM register. Alternatively, the "ANL direct" or "ORL direct" instructions can be used to clear or set bit 6 of the TRIM register.
On-Chip RC oscillator Option
The P89LPC901/902/903 has a 6-bit field within the TRIM register that can be used to tune the frequency of the RC oscillator. During reset, the TRIM value is initialized to a factory pre-programmed value to adjust the oscillator frequency to 7.373 MHz, ±1%. (Note: the initial value is better than 1%; please refer to the datasheet for behavior over temperature). End user applications can write to the TRIM register to adjust the on-chip RC oscillator to other frequencies. Increasing the TRIM value will decrease the oscillator frequency.
2003 Dec 8 28
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
If CCLK is 8MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to ’1’ to reduce power consumption. On reset, CLKLP is ’0’ allowing highest performance access. This bit can then be set in software if CCLK is running at 8MHz or slower.
TRIM
Address: 96h
Not bit addressable
Reset Source(s): Power-up only
Reset Value: On power-up reset, ENCLK = 0, and TRIM.5-0 are loaded with the factory programmed value.
BIT SYMBOL FUNCTION
TRIM.7 - Reserved.
TRIM.6 ENCLK When ENCLK =1, CCLK/ 2 is output on the XTAL2 pin (P3.0) provided that the crystal
TRIM.5-0 Trim value.
Note: on reset, the TRIM SFR is initialized with a factory preprogrammed value. When setting or clearing either the ENCLK or RCCLK bits, the user should retain the contents of bits 5:0 of the TRIM register. This can be done by reading the contents of the TRIM register (into the ACC for example), modifying bits 6 or 7, 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 or 7of the TRIM register.
76543210
- ENCLK TRIM.5 TRIM.4 TRIM.3 TRIM.2 TRIM.1 TRIM.0
oscillator is not being used. When ENCLK=0, no clock output is enabled.(P89LPC901).
Figure 2-2: On-Chip RC Oscillator TRIM Register
P89LPC901/902/903
Watchdog Oscillator Option
The watchdog has a separate oscillator which has a nominal frequency of 400KHz. This oscillator can be used to save power when a high clock frequency is not needed.
External Clock Input Option - P89LPC901
In this configuration, the processor clock is derived from an external source driving the XTAL1 / P3.1 pin. The rate may be from 0 Hz up to 12 MHz. The XTAL2 / P3.0 pin may be used as a standard port pin or a clock output.
2003 Dec 8 29
Philips Semiconductors
User’s Manual - Preliminary -
CLOCKS
.
XTAL1
XTAL2
RC Oscillator
(7.3728MHz)
Watchdog
Oscillator
(400KHz)
High freq.
Med freq.
Low freq.
FOSC2:0
OSC CLK
Oscillator
Clock
DIVM
CPU
Clock
P89LPC901/902/903
RTCS1:0
RTC
CCLK
CPU
/2
PCLK
WDT
Timer 0 & 1
Figure 2-3: Block Diagram of Oscillator Control - P89LPC901
2003 Dec 8 30
Loading...
+ 84 hidden pages