Page 5
Flash programming and erase................. 93 Using Flash as data storage: IAP-Lite ..............93 In-Circuit Programming (ICP) .................. 97 ISP and IAP capabilities of the P89LPC920/921/922..........97 Boot ROM........................ 98 Power-On reset code execution ................98 Hardware activation of the Boot Loader ..............98 In-System Programming (ISP).................
Page 6
User Manual - Subject to Change Philips Semiconductors P89LPC920/921/922 2003 Dec 8...
The P89LPC920/921/922 is a single-chip microcontroller designed for applications demanding high-integration, low cost solutions over a wide range of performance requirements. The P89LPC920/921/922 is based on a high performance processor architecture that executes instructions in two to four clocks, six times the rate of standard 80C51 devices. Many system level functions have been incorporated into the P89LPC920/921/922 in order to reduce component count, board space, and system cost.
Page 10
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Block diagram High Performance LPC920/921/922 CPU 256 Byte 2KB/ 4KB/ 8KB Data RAM Code Flash Internal Bus UART Port 3 Configurable I/Os Port 1 Real-Time Clock/ Configurable I/Os System Timer...
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Pin Descriptions Mnemonic Pin no. Type Name and function P0.0 - P0.7 1, 20, 19, Port 0: Port 0 is an 8-bit I/O port with a user-configurable output type. During reset...
Page 12
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Mnemonic Pin no. Type Name and function P1.0 - P1.7 12, 11, Port 1: Port 1 is an 8-bit I/O port with a user-configurable output type, except for 10, 9, 8, (for three pins as noted below.
Page 13
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Mnemonic Pin no. Type Name and function P3.1 Port 3 bit 1. 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...
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 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.
Page 15
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Bit Functions and Addresses Reset Value Name Description Address Binary Serial Clock Generator/SCL Duty I2SCLL# 00H 00000000 Cycle Register Low I2STAT# C Status Register STA.4 STA.3 STA.2 STA.1 STA.0 F8H 11111000...
Page 16
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 Bit Functions and Addresses Reset Value Name Description Address Binary PSW* Program Status Wword 00H 00000000 PT0AD# Port 0 Digital Input Disable PT0AD.5 PT0AD.4 PT0AD.3 PT0AD.2 PT0AD.1 xx00000x RSTSRC# Reset Source Register...
Page 17
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 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.
Special Function Registers. Selected CPU registers and peripheral control and status registers, accessible only via direct addressing. CODE 64 KB of Code memory space, accessed as part of program execution and via the MOVC instruction. The P89LPC920/921/922 has 2 KB/ 4 KB/ 8 KB of on-chip Code memory.). 2003 Dec 8...
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 DATA RAM ARRANGEMENT The 256 bytes of on-chip RAM is organized as follows: Type Data RAM Size (Bytes) DATA Memory that can be addressed directly and indirectly IDATA Memory that can be addressed indirectly (includes DATA) Table 1-1: On-chip data memory usage.
Page 20
Philips Semiconductors User’s Manual - Preliminary - General Description P89LPC920/921/922 2003 Dec 8...
2. CLOCKS Enhanced CPU The P89LPC920/921/922 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.
On-chip RC oscillator option The P89LPC920/921/922 has a 6-bit 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%;...
Oscillator Clock (OSCCLK) wakeup delay The P89LPC920/921/922 has an internal wakeup timer that delays the clock until it stabilizes depending to the clock source used. If the clock source is any of the three crystal selections, the delay is 992 OSCCLK cycles plus 60-100µs. If the clock source is either the internal RC oscillator or the Watchdog oscillator, the delay is 224 OSCCLK cycles plus 60-100µs.
Low power select The P89LPC920/921/922 is designed to run at 12 MHz (CCLK) maximum. However, if CCLK is 8 MHz or slower, the CLKLP SFR bit (AUXR1.7) can be set to a ‘1’ to lower the power consumption further. On any reset, CLKLP is ‘0’ allowing highest performance.
P89LPC920/921/922 3. INTERRUPTS The P89LPC920/921/922 uses a four priority level interrupt structure. This allows great flexibility in controlling the handling of the P89LPC920/921/922’s 12 interrupt sources. Each interrupt source can be individually enabled or disabled by setting or clearing a bit in the interrupt enable registers IEN0 or IEN1.
It is not necessary to clear the interrupt flag IEn when the interrupt is level sensitive, it simply tracks the input pin level. If an external interrupt is enabled when the P89LPC920/921/922 is put into Power down or Idle mode, the interrupt occurance will cause the processor to wake up and resume operation.
Philips Semiconductors User’s Manual - Preliminary - INTERRUPTS P89LPC920/921/922 BOPD Wakeup (if in RTCF KBIF Power down) ERTC EKBI (RTCCON.1) WDOVF EWDRT CMF2 CMF1 EA (IE0.7) TI & RI/RI ES/ESR Interrupt to CPU EI2C Figure 3-1: Interrupt sources, interrupt enables, and power down wake-up sources...
4. I/O PORTS The P89LPC920/921/922 has 3 I/O ports: Port 0, Port 1, and Port 3. Ports 0 and 1 are 8-bit ports and Port 3 is a 2-bit port. The exact number of I/O pins available depends upon the clock and reset options chosen (see Table 4-1) Table 4-1: .Number of I/O pins available...
The quasi-bidirectional port configuration is shown in Figure 4-1. Although the P89LPC920/921/922 is a 3 V device most of the pins are 5 V-tolerant. If 5 V is applied to a pin configured in quasi- bidirectional mode, there will be a current flowing from the pin to V causing extra power consumption.
Port 0 analog functions The P89LPC920/921/922 incorporates two Analog Comparators. In order to give the best analog performance and minimize power consumption, pins that are being used for analog functions must have both the digital outputs and digital inputs disabled.
• Pin P1.5 is input only. Pins P1.2 and P1.3 are configurable for either input-only or open drain. Every output on the P89LPC920/921/922 has been designed to sink typical LED drive current. However, there is a maximum total output current for all ports which must not be exceeded. Please refer to the P89LPC920/921/922 Datasheet for detailed specifications.
POWER MONITORING FUNCTIONS 5. POWER MONITORING FUNCTIONS The P89LPC920/921/922 incorporates power monitoring functions designed to prevent incorrect operation during initial power- on and power loss or reduction during operation. This is accomplished with two hardware functions: Power-on Detect and Brownout Detect.
(UCFG1.5) is programmed, BOF (RSTSRC.5) will be set when POF is set. If BOE is unprogrammed, BOF is meaningless. Power reduction modes The P89LPC920/921/922 supports three different power reduction modes as determined by SFR bits PCON.1-0 (see Table 5-2): 2003 Dec 8...
Power down mode: The Power down mode stops the oscillator in order to minimize power consumption. The P89LPC920/921/922 exits Power down mode via any reset, or certain interrupts - external pins INT0/INT1, brownout Interrupt, keyboard, Real-time Clock/System Timer), watchdog, and comparator trips.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 POWER MONITORING FUNCTIONS PCON Address: 87h SMOD1 SMOD0 BOPD PMOD1 PMOD0 Not bit addressable Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION PCON.7 SMOD1 Double Baud Rate bit for the serial port (UART) when Timer 1 is used as the baud rate source.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 POWER MONITORING FUNCTIONS PCONA Address: B5H RTCPD VCPD I2PD Not bit addressable Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION PCONA.7 RTCPD Real-time Clock Power down: When ‘1’, the internal clock to the Real-time Clock is disabled.
Page 38
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 POWER MONITORING FUNCTIONS 2003 Dec 8...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 RESET 6. RESET The P1.5/RST pin can function as either an active low reset input or as a digital input, P1.5. The RPE (Reset Pin Enable) bit in UCFG1, when set to 1, enables the external reset input function on P1.5. When cleared, P1.5 may be used as an input pin.
Reset vector Following reset, the P89LPC920//921/922 will fetch instructions from either address 0000h or the Boot address. The Boot address is formed by using the Boot Vector as the high byte of the address and the low byte of the address =00h. The Boot address will be used if a UART break reset occurs or the non-volatile Boot Status bit (BOOTSTAT.0) = 1, or the device has been...
7. TIMERS 0 AND 1 The P89LPC920/921/922 has two general-purpose counter/timers which are upward compatible with the 80C51 Timer 0 and Timer 1. Both can be configured to operate either as timers or event counters (see Figure 7-1). An option to automatically toggle the Tx pin upon timer overflow has been added.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 TIMERS 0 AND 1 TAMOD T1M2 T0M2 Address: 8Fh Not bit addressable Reset Source(s): Any reset Reset Value: xxx0xxx0B SYMBOL FUNCTION TAMOD.7-5 Reserved for future use. Should not be set to 1 by user programs.
TR1 and TF1 from Timer 1. Thus, TH0 now controls the “Timer 1” interrupt. Mode 3 is provided for applications that require an extra 8-bit timer. With Timer 0 in Mode 3, an P89LPC920/921/922 device can look like it has three Timer/Counters.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 TIMERS 0 AND 1 TCON Address: 88h Bit addressable Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION TCON.7 Timer 1 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when the interrupt is processed, or by software (except in mode 6, see above, when it is cleared in hardware).
8. REAL-TIME CLOCK/SYSTEM TIMER The P89LPC920/921/922 has a simple Real-time Clock/System Timer that allows a user to continue running an accurate timer while the rest of the device is powered down. The Real-time Clock can be an interrupt or a wake-up source (see Figure 8-1). The Real-time Clock is a 23-bit down counter.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 REAL-TIME CLOCK/SYSTEM TIMER Real-time Clock interrupt/wake up If ERTC (RTCCON.1), EWDRT (IEN1.0.6) and EA (IEN0.7) are set to ‘1’, RTCF can be used as an interrupt source. This interrupt vector is shared with the watchdog timer. It can also be a source to wake up the device.
Page 49
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 REAL-TIME CLOCK/SYSTEM TIMER RTCCON Address: D1h RTCF RTCS1 RTCS0 ERTC RTCEN Not bit addressable Reset Source(s): Power-up only Reset Value: 011xxx00B SYMBOL FUNCTION RTCCON.7 RTCF Real-time Clock Flag. This bit is set to ‘1’ when the 23-bit Real-time Clock reaches a count of ‘0’.
UART 9. UART The P89LPC920/921/922 has an enhanced UART that is compatible with the conventional 80C51 UART except that Timer 2 overflow cannot be used as a baud rate source. The P89LPC920/921/922 does include an independent Baud Rate Generator. The baud rate can be selected from the oscillator (divided by a constant), Timer 1 overflow, or the independent Baud Rate Generator.
Baud Rate Generator and selection The P89LPC920/921/922 enhanced UART has an independent Baud Rate Generator. The baud rate is determined by a value programmed into the BRGR1 and BRGR0 SFRs. The UART can use either Timer 1 or the baud rate generator output as determined by BRGCON.2-1 (see Figure 9-2).
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART BRGCON Address: BDh SBRGS BRGEN Not bit addressable Reset Source(s): Any reset Reset Value: xxxxxx00B SYMBOL FUNCTION BRGCON.7-2 Reserved for future use. Should not be set to 1 by user programs.
Page 54
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART SCON Address: 98h SM0/FE Bit addressable Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION SCON.7 SM0/FE The use of this bit is determined by SMOD0 in the PCON register. If SMOD0 = 0, this bit is read and written as SM0, which with SM1, defines the serial port mode.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART SSTAT Address: BAh Not bit addressable DBMOD INTLO CIDIS DBISEL STINT Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION SSTAT.7 DBMOD Double buffering mode. When set = 1 enables double buffering. Must be ‘0’ for UART mode 0.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART More about UART Modes 2 and 3 Reception is the same as in Mode 1. The signal to load SBUF and RB8, and to set RI, will be generated if, and only if, the following conditions are met at the time the final shift pulse is generated.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART bit. The break detect bit is cleared in software or by a reset. The break detect can be used to reset the device and force the device into ISP mode. This occurs if the UART is enabled and the the EBRR bit (AUXR1.6) is set and a break occurs.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 UART 8. The CPU writes to SBUF again. Then: - If INTLO is ‘0’, the new data will be loaded and a Tx interrupt will occur at the beginning of the STOP bit of the data cur- rently in the shifter.
STOP condition or with a repeated START condition. Since a repeated START condition is also the beginning of the next serial transfer, the I C-bus will not be released. The P89LPC920/921/922 device provides a byte-oriented I C interface. It has four operation modes: Master Transmitter Mode, Master Receiver Mode, Slave Transmitter Mode and Slave Receiver Mode.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE C Data register I2DAT register contains the data to be transmitted or the data received. The CPU can read and write to this 8-bit register while it is not in the process of shifting a byte. Thus this register should only be accessed when the SI bit is set. Data in I2DAT remains stable as long as the SI bit is set.
Page 65
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE The STA bit is START flag. Setting this bit causes the I C interface to enter master mode and attempt transmitting a START condition or transmitting a repeated START condition when it is already in master mode.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE C Status register This is a read-only register. It contains the status code of I C interface. The least three bits are always 0. There are 26 possible status codes. When the code is F8H, there is no relevant information available and SI bit is not set. All other 25 status codes correspond to defined I C states.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Slave Address DATA DATA Data Transferred “0” - Write (n Bytes + Acknowledge “1” - Read A = Acknowledge (SDA low) From Master to Slave A = Not Acknowledge (SDA high)
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Slave Receiver Mode In the Slave Receiver Mode, data bytes are received from a master transmitter. To initialize the Slave Receiver Mode, the user should write the slave address to the Slave Address Register (I2ADR) and the I...
Page 70
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Slave Address DATA DATA Data Transferred “0” - Write (n Bytes + Acknowledge “1” - Read A = Acknowledge (SDA low) From Master to Slave A = Not Acknowledge (SDA high)
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 2: Master Transmitter Mode Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON A START condition SLA+W will be transmitted; ACK bit will be...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 2: Master Transmitter Mode(Continued) Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON Data byte will be transmitted;...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 3: Master Receiver Mode(Continued) Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON No I2DAT action or Repeated START will be transmitted;...
Page 75
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 4: Slave Receiver Mode(Continued) Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON Arbitration lost in Data byte will be received and NOT ACK will...
Page 76
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 4: Slave Receiver Mode(Continued) Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON Switched to not addressed SLA mode; no...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 5: Slave Transmitter Mode Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON Last data byte will be transmitted and ACK...
Page 78
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 C INTERFACE Table 5: Slave Transmitter Mode(Continued) Application software response Status code Status of the Next action taken by I (I2STAT) C-bus hardware hardware to/from I2DAT to I2CON Switched to not addressed SLA mode; no...
11. ANALOG COMPARATORS Two analog comparators are provided on the P89LPC920/921/922. Input and output options allow use of the comparators in a number of different configurations. Comparator operation is such that the output is a logical one (which may be read in a register and/or routed to a pin) when the positive input (one of two selectable pins) is greater than the negative input (selectable from a pin or an internal reference voltage).
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 ANALOG COMPARATORS Comparators consume power in Power down and Idle modes, as well as in the normal operating mode. This should be taken into consideration when system power consumption is an issue. To minimize power consumption, the user can Power down the comparators by disabling the comparators and setting PCONA.5 to ‘1’, or simply putting the device in Total Power down mode.
Page 82
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 ANALOG COMPARATORS ; Return to caller. The interrupt routine used for the comparator must clear the interrupt flag (CMF1 in this case) before returning. 2003 Dec 8...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 KEYPAD INTERRUPT (KBI) 12. KEYPAD INTERRUPT (KBI) The Keypad Interrupt function is intended primarily to allow a single interrupt to be generated when Port 0 is equal to or not equal to a certain pattern. This function can be used for bus address recognition or keypad recognition. The user can configure the port via SFRs for different tasks.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 KEYPAD INTERRUPT (KBI) KBMASK Address: 86h KBMASK.7 KBMASK.6 KBMASK.5 KBMASK.4 KBMASK.3 KBMASK.2 KBMASK.1 KBMASK.0 Not bit addressable Reset Source(s): Any reset Reset Value: 00000000B SYMBOL FUNCTION KBMASK.7 When set, enables P0.7 as a cause of a Keypad Interrupt.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 WATCHDOG TIMER 13. WATCHDOG TIMER The watchdog timer subsystem protects the system from incorrect code execution by causing a system reset when it underflows as a result of a failure of software to feed the timer prior to the timer reaching its terminal count. The watchdog timer can only be reset by a power-on reset.
• WDL is the value of watchdog load register which can be the range of 0-255. The minimum number of tclks is: (5+0) tclks = (2 )(0+1)+1 = 33 The maximum number of tclks is: (5+7) tclks = (2 )(255+1)+1 = 1,048,577T The following table show sample P89LPC920/921/922 timeout values 2003 Dec 8...
Timer0 overflow rate. Refer to the Timer/Counters section for details. AUXR1.3 SRST Software Reset. When set by software, resets the P89LPC920/921/922 as if a hardware reset occurred. AUXR1.2 This bit contains a hard-wired 0. Allows toggling of the DPS bit by incrementing AUXR1, without interfering with other bits in the register.
Page 92
Also, any instruction that reads or manipulates the DPH and DPL registers (the upper and lower bytes of the current DPTR) will be affected by the setting of DPS. The MOVX instructions have limited application for the P89LPC920/921/922 since the part does not have an external data bus.
Flash programming and erase The P89LPC920/921/922 program memory consists 1 KB sectors. Each sector can be further divided into 64-byte pages. In addition to sector erase and page erase, a 64-byte page register is included which allows from 1 to 64 bytes of a given page to be programmed at the same time, substantially reducing overall programming time.
Page 94
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY grammed in a single operation without the need to erase or program any other bytes in the page. IAP-Lite is performed in the application under the control of the microcontroller’s firmware using four SFRs and an internal 64-byte "page register" to facili- tate erasing and programing within unsecured sectors.
Page 95
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY similar C-language routine is shown in Figure 15-3. FMCON Address: E4h Not bit addressable Reset Source(s): Any reset Reset Value: SYMBOL FUNCTION FMCON.7-4 Reserved. FMCON.3 High voltage abort. Set if either an interrupt or a brown-out is detected during a program or erase cycle.
Page 96
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY ;* Inputs: R3 = number of bytes to program (byte) R4 = page address MSB(byte) R5 = page address LSB(byte) R7 = pointer to data buffer in RAM(byte) ;* Outputs:...
The In-Circuit Programming facility consists of a series of internal hardware resources to facilitate remote programming of the P89LPC920/921/922 through a two-wire serial interface. Philips has made in- circuit programming in an embedded application possible with a minimum of additional expense in components and circuit board area.
The P89LPC920/921/922 contains two special Flash elements: the BOOT VECTOR and the Boot Status Bit. Following reset, the P89LPC920/921/922 examines the contents of the Boot Status Bit. If the Boot Status Bit is set to zero, power-up execution starts at location 0000H, which is the normal start address of the user’s application code. When the Boot Status Bit is set to a va one, the contents of the Boot Vector is used as the high byte of the execution address and the low byte is set to 00H.
:NNAAAARRDD..DDCC<crlf> In the Intel Hex record, the “NN” represents the number of data bytes in the record. The P89LPC920/921/922 will accept up to 64 (40H) data bytes. The “AAAA” string represents the address of the first byte in the record. If there are zero bytes in the record, this field is often set to 0000.
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-2: In-System Programming (ISP) hex record formats Record type Command/data function Program User Code Memory Page :nnaaaa00dd..ddcc Where: = number of bytes to program aaaa = page address dd..dd...
Page 101
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-2: In-System Programming (ISP) hex record formats Record type Command/data function Miscellaneous Write Functions :02xxxx02ssddcc Where: xxxx = required field but value is a “don’t care” = subfunction code...
Page 102
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-2: In-System Programming (ISP) hex record formats Record type Command/data function Miscellaneous Read Functions :01xxxx03sscc Where xxxx = required field but value is a “don’t care” = subfunction code...
Page 103
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-2: In-System Programming (ISP) hex record formats Record type Command/data function Erase Sector/Page :03xxxx04ssaaaacc Where: xxxx = required field but value is a “don’t care” aaaa = sector/page address...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-2: In-System Programming (ISP) hex record formats Record type Command/data function Reset MCU :00xxxx08cc Where: xxxx = required field but value is a “don’t care” = checksum Example: :00000008F8...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-3: IAP error status Flag Description Operation Interrupted. Indicates that an operation was aborted due to an interrupt occuring during a program or erase cycle. Security Violation. Set if program or erase operation fails due to security settings. Cycle is aborted.Memory contents are unchanged.
Page 106
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY Table 15-4: IAP function calls IAP function IAP call parameters Input parameters: = 02h = data to write = register address = UCFG1 = reserved = Boot Vector = Status Byte...
User configuration bytes A number of user-configurable features of the P89LPC920/921/922 must be defined at power-up and therefore cannot be set by the program after start of execution. These features are configured through the use of an Flash byte UCFG1 shown in Figure 15-...
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 FLASH MEMORY User security bytes This device has three security bits associated with each of its eight sectors, as shown in Figure 6. SECx Address: xxxxh EDISx SPEDISxMOVCDISx Unprogrammed value: 00h SYMBOL FUNCTION SECx.7-3...
Reserved (should remain unprogrammed at zero). BOOTVEC.4-0 Boot Vector. If the Boot Vector is selected as the reset address, the P89LPC920/921/922 will start execution at an address comprised of 00H in the lower eight bits and this BOOTVEC as the upper bits after a reset. (See section "Reset vector" on page 40).
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 INSTRUCTION SET 16. INSTRUCTION SET Table 16-1: Instruction set summary Mnemonic Description Bytes Cycles code ARITHMETIC ADD A,Rn Add register to A 28-2F ADD A,dir Add direct byte to A ADD A,@Ri...
Page 114
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 INSTRUCTION SET Mnemonic Description Bytes Cycles code ANL dir,A AND A to direct byte ANL dir,#data AND immediate to direct byte ORL A,Rn OR register to A 48-4F ORL A,dir OR direct byte to A...
Page 115
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 INSTRUCTION SET Mnemonic Description Bytes Cycles code MOV dir,#data Move immediate to direct byte MOV @Ri,A Move A to indirect memory F6-F7 MOV @Ri,dir Move direct byte to indirect memory A6-A7 MOV @Ri,#data...
Page 116
Philips Semiconductors User’s Manual - Preliminary - P89LPC920/921/922 INSTRUCTION SET Mnemonic Description Bytes Cycles code ACALL addr 11 Absolute jump to subroutine 116F1 LCALL addr 16 Long jump to subroutine Return from subroutine RETI Return from interrupt AJMP addr 11...
User Manual - Subject to Change Philips Semiconductors P89LPC920/921/922 INDEX 18. INDEX Analog comparators 31 configuration 79 configuration example 81 enabling 79 internal reference voltage 80 interrupt 80 power reduction modes 80, 81 Analog comparators and power reduction 31 Block diagram 10...
Page 121
User Manual - Subject to Change Philips Semiconductors P89LPC920/921/922 INDEX Low power (CLKP) 24 Memory Code 18 Data 18 FLASH code 93 IDATA 18 organization 18 Oscillator high speed option 21 low speed option 21 meduim speed option 21 RC option 22...
Page 122
User Manual - Subject to Change Philips Semiconductors P89LPC920/921/922 INDEX Real time clock clock sources 47 interrupt/wake up 48 Reset enabling the external reset input pin 39, 109 software reset 91 sources 39 UART break-detect, ISP entry 40 AUXR1 91...
Page 123
User Manual - Subject to Change Philips Semiconductors P89LPC920/921/922 INDEX Timer/counters mode 0 42 mode 1 42 mode 2 (8-bit auto reload) 43 mode 3 (seperates TL0 & TH0) 43 mode 6 (8-bit PWM) 43 toggle output 46 TRIM (SFR)
Page 124
Life support — These products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Philips Semiconductors customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from such application.