xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx
xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
P89LV51RB2_RC2_RD2_5 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 05 — 15 December 2009 13 of 76
NXP Semiconductors
P89LV51RB2/RC2/RD2
8-bit microcontrollers with 80C51 core
[1] Unimplemented bits in SFRs (labeled ’-’) are ‘X’s (unknown) at all times. Unless otherwise specified, ‘1’s 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.
SADDR Serial Port Address Register A9H
SADEN Serial Port Address Enable B9H
Bit address 87
[1]
86
[1]
85
[1]
84
[1]
83
[1]
82
[1]
81
[1]
80
[1]
SPCTL SPI Control Register D5H SPIE SPEN DORD MSTR CPOL CPHA PSC1 PSC0
SPCFG SPI Configuration Register AAH SPIF WCOL ------
SPDAT SPI Data 86H
SP Stack Pointer 81H
Bit address 8F 8E 8D 8C 8B 8A 89 88
TCON* Timer Control Register 88H TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
Bit address CF CE CD CC CB CA C9 C8
T2CON* Timer2 Control Register C8H TF2 EXF2 RCLK TCLK EXEN2 TR2 C/
T2 CP/RL2
T2MOD Timer2 Mode Control C9H - - ENT2 - - - T2OE DCEN
TH0 Timer 0 HIGH 8CH
TH1 Timer 1 HIGH 8DH
TH2 Timer 2 HIGH CDH
TL0 Timer 0 LOW 8AH
TL1 Timer 1 LOW 8BH
TL2 Timer 2 LOW CCH
TMOD Timer 0 and 1 Mode 89H T1GATE T1C/T T1M1 T1M0 T0GATE T0C/T T0M1 T0M0
WDTC Watchdog Timer Control C0H - - - WDOUT WDRE WDTS WDT SWDT
WDTD Watchdog Timer Data/Reload 85H
Table 4. Special function registers
…continued
* Indicates SFRs that are bit addressable.
Name Description SFR
addr.
Bit functions and addresses
MSB LSB
P89LV51RB2_RC2_RD2_5 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 05 — 15 December 2009 14 of 76
NXP Semiconductors
P89LV51RB2/RC2/RD2
8-bit microcontrollers with 80C51 core
6.2 Memory organization
The device has separate address spaces for program and data memory.
6.2.1 Flash program memory bank selection
There are two internal flash memory blocks in the device. Block 0 has 16/32/64 kB and is
organized as 128/256/512 sectors, each sector consists of 128 B. Block 1 contains the
IAP/ISP routines and may be enabled such that it overlays the first 8 kB of the user code
memory. The overlay function is controlled by the combination of the Software Reset Bit
(SWR) at FCF.1 and the Bank Select Bit (BSEL) at FCF.0. The combination of these bits
and the memory source used for instructions is shown in Table 5.
Access to the IAP routines in block 1 may be enabled by clearing the BSEL bit (FCF.0),
provided that the SWR bit (FCF.1) is cleared. Following a power-on sequence, the boot
code is automatically executed and attempts to autobaud to a host. If no autobaud occurs
within approximately 400 ms and the SoftICE flag is not set, control will be passed to the
user code. A software reset is used to accomplish this control transfer and as a result the
SWR bit will remain set. Therefore the user's code will need to clear the SWR bit in
order to access the IAP routines in block 1. However, caution must be taken when
dynamically changing the BSEL bit. Since this will cause different physical memory to be
mapped to the logical program address space, the user must avoid clearing the BSEL bit
when executing user code within the address range 0000H to 1FFFH.
6.2.2 Power-on reset code execution
At initial power up, the port pins will be in a random state until the oscillator has started
and the internal reset algorithm has weakly pulled all pins high. Powering up the device
without a valid reset could cause the MCU to start executing instructions from an
indeterminate location. Such undefined states may inadvertently corrupt the code in the
flash. A system reset will not affect the 1 kB of on-chip RAM while the device is running,
however, the contents of the on-chip RAM during power up are indeterminate.
When power is applied to the device, the RST pin must be held high long enough for the
oscillator to start up (usually several milliseconds for a low frequency crystal), in addition
to two machine cycles for a valid power-on reset. An example of a method to extend the
RST signal is to implement a RC circuit by connecting the RST pin to V
DD
through a 10 µF
capacitor and to V
SS
through an 8.2 k resistor as shown in Figure 4. Note that if an RC
circuit is used, provision should be made to ensure the V
DD
rise time does not exceed
1 ms and the oscillator start-up time does not exceed 10 ms.
For a low frequency oscillator with slow start-up time the reset signal must be extended in
order to account for the slow start-up time. This method maintains the necessary
relationship between V
DD
and RST to avoid programming at an indeterminate location,
which may cause corruption in the Flash code. The power-on detection is designed to
Table 5. Code memory bank selection
SWR (FCF.1) BSEL (FCF.0) Addresses from
0000H to 1FFFH
Addresses above
1FFFH
0 0 boot code (in block 1) user code (in block 0)
0 1 user code (in block 0)
10
11
P89LV51RB2_RC2_RD2_5 © NXP B.V. 2009. All rights reserved.
Product data sheet Rev. 05 — 15 December 2009 15 of 76
NXP Semiconductors
P89LV51RB2/RC2/RD2
8-bit microcontrollers with 80C51 core
work during initial power up, before the voltage reaches the brownout detection level. The
POF flag in the PCON register is set to indicate an initial power up condition. The POF
flag will remain active until cleared by software.
Following a power-on or external reset the P89LV51RB2/RC2/RD2 will force the SWR and
BSEL bits (FCF[1:0]) to 00. This causes the boot block to be mapped into the lower 8 kB
of code memory and the device will execute the ISP code in the boot block and attempt to
autobaud to the host. If the autobaud is successful the device will remain in ISP mode. If,
after approximately 400 ms, the autobaud is unsuccessful the boot block code will check
to see if the SoftICE flag is set (from a previous programming operation). If the SoftICE
flag is set the device will enter SoftICE mode. If the SoftICE flag is cleared, the boot code
will execute a software reset causing the device to execute the user code from block 0
starting at address 0000H. Note that an external reset applied to the RST pin has the
same effect as a power-on reset.
6.2.3 Software reset
A software reset is executed by changing the SWR bit (FCF.1) from ‘0’ to ‘1’. A software
reset will reset the program counter to address 0000H and force both the SWR and BSEL
bits (FCF[1:0]) to 10. This will result in the lower 8 kB of the user code memory being
mapped into the user code memory space. Thus the user's code will be executed starting
at address 0000H. A software reset will not change bit WDTC.2 or RAM data. Other SFRs
will be set to their reset values.
6.2.4 Brownout detect reset
The device includes a brownout detection circuit to protect the system from severe supply
voltage fluctuations. The P89LV51RB2/RC2/RD2's brownout detection threshold is 2.35 V.
When V
DD
drops below this voltage threshold, the brownout detect triggers the circuit to
generate a brownout interrupt but the CPU still runs until the supplied voltage returns to
the brownout detection voltage V
bo
. The default operation for a brownout detection is to
cause a processor reset.
Fig 4. Power-on reset circuit
002aaa543
V
DD
V
DD
8.2 k
RST
XTAL2
XTAL1
C
1
C
2
10 µF

P89LV51RC2FA,512

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
IC MCU 8BIT 32KB FLASH 44PLCC
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union