P89LPC9351_1 © NXP B.V. 2008. All rights reserved.
Preliminary data sheet Rev. 01 — 19 November 2008 73 of 74
continued >>
NXP Semiconductors
P89LPC9351
8-bit microcontroller with 8-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 . . . . . . . . . . . . . . . . . . . . . . . . . 7
7 Functional description . . . . . . . . . . . . . . . . . . 11
7.1 Special function registers . . . . . . . . . . . . . . . . 11
7.2 Enhanced CPU. . . . . . . . . . . . . . . . . . . . . . . . 22
7.3 Clocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.1 Clock definitions . . . . . . . . . . . . . . . . . . . . . . . 22
7.3.2 CPU clock (OSCCLK). . . . . . . . . . . . . . . . . . . 22
7.4 External crystal oscillator option. . . . . . . . . . . 22
7.4.1 Low speed oscillator option . . . . . . . . . . . . . . 22
7.4.2 Medium speed oscillator option . . . . . . . . . . . 22
7.4.3 High speed oscillator option . . . . . . . . . . . . . . 22
7.5 Clock output . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.6 On-chip RC oscillator option. . . . . . . . . . . . . . 23
7.7 Watchdog oscillator option . . . . . . . . . . . . . . . 23
7.8 External clock input option . . . . . . . . . . . . . . . 23
7.9 Clock sources switch on the fly. . . . . . . . . . . . 23
7.10 CCLK wake-up delay . . . . . . . . . . . . . . . . . . . 24
7.11 CCLK modification: DIVM register . . . . . . . . . 24
7.12 Low power select . . . . . . . . . . . . . . . . . . . . . . 24
7.13 Memory organization . . . . . . . . . . . . . . . . . . . 25
7.14 Data RAM arrangement . . . . . . . . . . . . . . . . . 25
7.15 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.15.1 External interrupt inputs . . . . . . . . . . . . . . . . . 26
7.16 I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.16.1 Port configurations . . . . . . . . . . . . . . . . . . . . . 28
7.16.1.1 Quasi-bidirectional output configuration . . . . . 28
7.16.1.2 Open-drain output configuration . . . . . . . . . . . 28
7.16.1.3 Input-only configuration . . . . . . . . . . . . . . . . . 29
7.16.1.4 Push-pull output configuration . . . . . . . . . . . . 29
7.16.2 Port 0 analog functions. . . . . . . . . . . . . . . . . . 29
7.16.3 Additional port features. . . . . . . . . . . . . . . . . . 29
7.17 Power monitoring functions. . . . . . . . . . . . . . . 29
7.17.1 Brownout detection. . . . . . . . . . . . . . . . . . . . . 30
7.17.2 Power-on detection. . . . . . . . . . . . . . . . . . . . . 30
7.18 Power reduction modes . . . . . . . . . . . . . . . . . 30
7.18.1 Idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.18.2 Power-down mode . . . . . . . . . . . . . . . . . . . . . 30
7.18.3 Total Power-down mode. . . . . . . . . . . . . . . . . 31
7.19 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
7.19.1 Reset vector. . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20 Timers/counters 0 and 1 . . . . . . . . . . . . . . . . 32
7.20.1 Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20.2 Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20.3 Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20.4 Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20.5 Mode 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7.20.6 Timer overflow toggle output . . . . . . . . . . . . . 33
7.21 RTC/system timer. . . . . . . . . . . . . . . . . . . . . . 33
7.22 CCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.22.1 CCU clock . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.22.2 CCUCLK prescaling. . . . . . . . . . . . . . . . . . . . 33
7.22.3 Basic timer operation . . . . . . . . . . . . . . . . . . . 33
7.22.4 Output compare . . . . . . . . . . . . . . . . . . . . . . . 34
7.22.5 Input capture . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.22.6 PWM operation . . . . . . . . . . . . . . . . . . . . . . . 34
7.22.7 Alternating output mode. . . . . . . . . . . . . . . . . 35
7.22.8 PLL operation. . . . . . . . . . . . . . . . . . . . . . . . . 35
7.22.9 CCU interrupts . . . . . . . . . . . . . . . . . . . . . . . . 36
7.23 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
7.23.1 Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
7.23.2 Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.23.3 Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.23.4 Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.23.5 Baud rate generator and selection. . . . . . . . . 37
7.23.6 Framing error . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.23.7 Break detect. . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.23.8 Double buffering. . . . . . . . . . . . . . . . . . . . . . . 38
7.23.9 Transmit interrupts with double buffering
enabled (modes 1, 2 and 3) . . . . . . . . . . . . . . 38
7.23.10 The 9
th
bit (bit 8) in double buffering
(modes 1, 2 and 3). . . . . . . . . . . . . . . . . . . . . 38
7.24 I
2
C-bus serial interface. . . . . . . . . . . . . . . . . . 38
7.25 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7.25.1 Typical SPI configurations . . . . . . . . . . . . . . . 42
7.26 Analog comparators. . . . . . . . . . . . . . . . . . . . 43
7.26.1 Internal reference voltage. . . . . . . . . . . . . . . . 44
7.26.2 Comparator interrupt . . . . . . . . . . . . . . . . . . . 44
7.26.3 Comparators and power reduction modes . . . 44
7.27 KBI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.28 Watchdog timer . . . . . . . . . . . . . . . . . . . . . . . 45
7.29 Additional features . . . . . . . . . . . . . . . . . . . . . 46
7.29.1 Software reset . . . . . . . . . . . . . . . . . . . . . . . . 46
7.29.2 Dual data pointers . . . . . . . . . . . . . . . . . . . . . 46
7.29.3 Data EEPROM. . . . . . . . . . . . . . . . . . . . . . . . 46
7.30 Flash program memory . . . . . . . . . . . . . . . . . 47