© Koninklijke Philips Electronics N.V.
2005
All rights are reserved. Reproduction in whole or in part is prohibited without the prior
written consent of the copyright owner. The information presented in this document does
not form part of any quotation or contract, is believed to be accurate and reliable and may
be changed without notice. No liability will be accepted by the publisher for any
consequence of its use. Publication thereof does not convey nor imply any license under
patent- or other industrial or intellectual property rights.
Date of release: 7 June 2005
Published in the Netherlands
Philips Semiconductors
UM10119
P89LPC938 User manual
More about UART Modes 2 and 3 . . . . . . . . . 71
Break detect . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Double buffering . . . . . . . . . . . . . . . . . . . . . . . 72
Double buffering in different modes . . . . . . . . 72
Multiprocessor communications . . . . . . . . . . . 74
Automatic address recognition . . . . . . . . . . . . 75
2
C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
C data register . . . . . . . . . . . . . . . . . . . . . . . 77
2
C slave address register . . . . . . . . . . . . . . . 77
C control register . . . . . . . . . . . . . . . . . . . . . 78
C Status register . . . . . . . . . . . . . . . . . . . . . 79
C SCL duty cycle registers I2SCLH and
I2SCLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
C operation modes . . . . . . . . . . . . . . . . . . . . 80
Master Transmitter mode . . . . . . . . . . . . . . . . 80
Master Receiver mode . . . . . . . . . . . . . . . . . . 81
Slave Receiver mode . . . . . . . . . . . . . . . . . . . 82
Slave Transmitter mode . . . . . . . . . . . . . . . . . 83
Serial Peripheral Interface (SPI) . . . . . . . . . . . 90
Configuring the SPI . . . . . . . . . . . . . . . . . . . . 94
Additional considerations for a slave . . . . . . . 95
Additional considerations for a master . . . . . . 95
Mode change on SS . . . . . . . . . . . . . . . . . . . . 95
Write collision . . . . . . . . . . . . . . . . . . . . . . . . . 96
Data mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
SPI clock prescaler select. . . . . . . . . . . . . . . 100
Analog comparators . . . . . . . . . . . . . . . . . . . 100
Comparator configuration . . . . . . . . . . . . . . . 100
Internal reference voltage . . . . . . . . . . . . . . . 102
Comparator input pins . . . . . . . . . . . . . . . . . 102
Comparator interrupt . . . . . . . . . . . . . . . . . . 102
Comparators and power reduction modes . . 102
Comparators configuration example . . . . . . . 103
Keypad interrupt (KBI). . . . . . . . . . . . . . . . . . 104
Watchdog timer (WDT) . . . . . . . . . . . . . . . . . 105
Watchdog function . . . . . . . . . . . . . . . . . . . . 105
Feed sequence . . . . . . . . . . . . . . . . . . . . . . . 106
Watchdog clock source . . . . . . . . . . . . . . . . 109
Watchdog Timer in Timer mode . . . . . . . . . . 110
Power-down operation . . . . . . . . . . . . . . . . . 111
Additional features . . . . . . . . . . . . . . . . . . . . 111
Software reset . . . . . . . . . . . . . . . . . . . . . . . 112
Dual Data Pointers . . . . . . . . . . . . . . . . . . . . 112
Data EEPROM . . . . . . . . . . . . . . . . . . . . . . . . 112
Data EEPROM read. . . . . . . . . . . . . . . . . . . 113
Data EEPROM write . . . . . . . . . . . . . . . . . . 114
Hardware reset . . . . . . . . . . . . . . . . . . . . . . 114
Multiple writes to the DEEDAT register . . . . 114
Data EEPROM Row Fill . . . . . . . . . . . . . . . . 114
Data EEPROM Block Fill . . . . . . . . . . . . . . . 115
Flash memory . . . . . . . . . . . . . . . . . . . . . . . . 115
General description . . . . . . . . . . . . . . . . . . . 115
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Flash programming and erase . . . . . . . . . . . 116
Using Flash as data storage: IAP-Lite . . . . . 116
In-circuit programming (ICP) . . . . . . . . . . . . 120
ISP and IAP capabilities of the P89LPC938 120
Boot ROM . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Power on reset code execution . . . . . . . . . . 120
Hardware activation of Boot Loader. . . . . . . 121
In-system programming (ISP) . . . . . . . . . . . 121
Using the In-system programming (ISP) . . . 122
In-application programming (IAP) . . . . . . . . 125
IAP authorization key . . . . . . . . . . . . . . . . . . 126
Flash write enable . . . . . . . . . . . . . . . . . . . . 126
Configuration byte protection . . . . . . . . . . . . 126
IAP error status . . . . . . . . . . . . . . . . . . . . . . 127
User configuration bytes . . . . . . . . . . . . . . . 130
User security bytes . . . . . . . . . . . . . . . . . . . 131
Boot Vector register . . . . . . . . . . . . . . . . . . . 132
Boot status register . . . . . . . . . . . . . . . . . . . 132
Instruction set . . . . . . . . . . . . . . . . . . . . . . . . 134
Disclaimers . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . 137