P89LPC952_954_4 © NXP B.V. 2008. All rights reserved.
Product data sheet Rev. 04 — 24 July 2008 68 of 69
continued >>
NXP Semiconductors
P89LPC952/954
8-bit microcontroller with 10-bit ADC
18. Contents
1 General description. . . . . . . . . . . . . . . . . . . . . . 1
2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.1 Principal features . . . . . . . . . . . . . . . . . . . . . . . 1
2.2 Additional features . . . . . . . . . . . . . . . . . . . . . . 2
3 Ordering information . . . . . . . . . . . . . . . . . . . . . 3
3.1 Ordering options . . . . . . . . . . . . . . . . . . . . . . . . 3
4 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5 Functional diagram . . . . . . . . . . . . . . . . . . . . . . 5
6 Pinning information. . . . . . . . . . . . . . . . . . . . . . 6
6.1 Pinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.2 Pin description . . . . . . . . . . . . . . . . . . . . . . . . . 9
7 Functional description . . . . . . . . . . . . . . . . . . 14
7.1 Special function registers . . . . . . . . . . . . . . . . 14
7.2 Enhanced CPU. . . . . . . . . . . . . . . . . . . . . . . . 23
7.3 Clocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.3.1 Clock definitions . . . . . . . . . . . . . . . . . . . . . . . 23
7.3.2 CPU clock (OSCCLK). . . . . . . . . . . . . . . . . . . 23
7.3.3 Low speed oscillator option . . . . . . . . . . . . . . 23
7.3.4 Medium speed oscillator option . . . . . . . . . . . 23
7.3.5 High speed oscillator option . . . . . . . . . . . . . . 23
7.3.6 Clock output . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.4 On-chip RC oscillator option. . . . . . . . . . . . . . 24
7.5 Watchdog oscillator option . . . . . . . . . . . . . . . 24
7.6 External clock input option . . . . . . . . . . . . . . . 24
7.7 CCLK wake-up delay . . . . . . . . . . . . . . . . . . . 25
7.8 CCLK modification: DIVM register . . . . . . . . . 25
7.9 Low power select . . . . . . . . . . . . . . . . . . . . . . 25
7.10 Memory organization . . . . . . . . . . . . . . . . . . . 26
7.11 Data RAM arrangement . . . . . . . . . . . . . . . . . 26
7.12 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.12.1 External interrupt inputs . . . . . . . . . . . . . . . . . 27
7.13 I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.13.1 Port configurations . . . . . . . . . . . . . . . . . . . . . 29
7.13.1.1 Quasi-bidirectional output configuration . . . . . 29
7.13.1.2 Open-drain output configuration . . . . . . . . . . . 29
7.13.1.3 Input-only configuration . . . . . . . . . . . . . . . . . 30
7.13.1.4 Push-pull output configuration . . . . . . . . . . . . 30
7.13.2 Port 0 analog functions. . . . . . . . . . . . . . . . . . 30
7.13.3 Additional port features. . . . . . . . . . . . . . . . . . 30
7.14 Power monitoring functions. . . . . . . . . . . . . . . 30
7.14.1 Brownout detection. . . . . . . . . . . . . . . . . . . . . 30
7.14.2 Power-on detection. . . . . . . . . . . . . . . . . . . . . 31
7.15 Power reduction modes . . . . . . . . . . . . . . . . . 31
7.15.1 Idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.15.2 Power-down mode . . . . . . . . . . . . . . . . . . . . . 31
7.15.3 Total Power-down mode . . . . . . . . . . . . . . . . . 31
7.16 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.16.1 Reset vector. . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17 Timers/counters 0 and 1 . . . . . . . . . . . . . . . . 33
7.17.1 Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17.2 Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17.3 Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17.4 Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17.5 Mode 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.17.6 Timer overflow toggle output . . . . . . . . . . . . . 34
7.18 RTC/system timer. . . . . . . . . . . . . . . . . . . . . . 34
7.19 UARTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.19.1 Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.19.2 Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.19.3 Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.19.4 Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.19.5 Baud rate generator and selection. . . . . . . . . 35
7.19.6 Framing error . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.19.7 Break detect. . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.19.8 Double buffering. . . . . . . . . . . . . . . . . . . . . . . 35
7.19.9 Transmit interrupts with double buffering
enabled (Modes 1, 2 and 3) . . . . . . . . . . . . . . 36
7.19.10 The 9
th
bit (bit 8) in double buffering
(Modes 1, 2 and 3). . . . . . . . . . . . . . . . . . . . . 36
7.20 I
2
C-bus serial interface. . . . . . . . . . . . . . . . . . 36
7.21 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.21.1 Typical SPI configurations . . . . . . . . . . . . . . . 39
7.22 Analog comparators. . . . . . . . . . . . . . . . . . . . 40
7.22.1 Internal reference voltage. . . . . . . . . . . . . . . . 41
7.22.2 Comparator interrupt . . . . . . . . . . . . . . . . . . . 41
7.22.3 Comparators and power reduction modes . . . 41
7.23 KBI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
7.24 Watchdog timer . . . . . . . . . . . . . . . . . . . . . . . 42
7.25 Additional features . . . . . . . . . . . . . . . . . . . . . 43
7.25.1 Software reset . . . . . . . . . . . . . . . . . . . . . . . . 43
7.25.2 Dual data pointers . . . . . . . . . . . . . . . . . . . . . 43
7.25.3 Debugger interface. . . . . . . . . . . . . . . . . . . . . 43
7.26 Flash program memory . . . . . . . . . . . . . . . . . 44
7.26.1 General description . . . . . . . . . . . . . . . . . . . . 44
7.26.2 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.26.3 Flash organization . . . . . . . . . . . . . . . . . . . . . 44
7.26.4 Using flash as data storage . . . . . . . . . . . . . . 44
7.26.5 Flash programming and erasing. . . . . . . . . . . 45
7.26.6 ICP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.26.7 IAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.26.8 ISP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.26.9 Power-on reset code execution . . . . . . . . . . . 46
7.26.10 Hardware activation of the bootloader . . . . . . 46
7.27 User configuration bytes. . . . . . . . . . . . . . . . . 46
7.28 User sector security bytes . . . . . . . . . . . . . . . 46