Philips Semiconductors Product data
P89C660/P89C662/P89C664/
P89C668
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM
2002 Oct 28
49
SMOD1 SMOD0 POF LVF GF0 GF1 IDL
PCON
(87H)
SM0 / FE SM1 SM2 REN TB8 RB8 TI RI
S0CON
(98H)
D0 D1 D2 D3 D4 D5 D6 D7 D8
STOP
BIT
DATA BYTE
ONLY IN
MODE 2, 3
START
BIT
SET FE BIT IF STOP BIT IS 0 (FRAMING ERROR)
SM0 TO UART MODE CONTROL
0 : S0CON.7 = SM0
1 : S0CON.7 = FE
SU01452
Figure 33. UART Framing Error Detection
SM0 SM1 SM2 REN TB8 RB8 TI RI
S0CON
(98H)
D0 D1 D2 D3 D4 D5 D6 D7 D8
1
1
1
0
COMPARATOR
11 X
RECEIVED ADDRESS D0 TO D7
PROGRAMMED ADDRESS
IN UART MODE 2 OR MODE 3 AND SM2 = 1:
INTERRUPT IF REN=1, RB8=1 AND “RECEIVED ADDRESS” = “PROGRAMMED ADDRESS”
– WHEN OWN ADDRESS RECEIVED, CLEAR SM2 TO RECEIVE DATA BYTES
– WHEN ALL DATA BYTES HAVE BEEN RECEIVED: SET SM2 TO WAIT FOR NEXT ADDRESS.
SU01453
Figure 34. UART Multiprocessor Communication, Automatic Address Recognition
Philips Semiconductors Product data
P89C660/P89C662/P89C664/
P89C668
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM
2002 Oct 28
50
Interrupt Priority Structure
The P89C660/662/664/668 has an 8 source four-level interrupt
structure (see Table 13).
There are 4 SFRs associated with the four-level interrupt. They are
the IE, IP, IEN1, and IPH (see Figures 35, 36, 37, and 38). The IPH
(Interrupt Priority High) register makes the four-level interrupt
structure possible. The IPH is located at SFR address B7H. The
structure of the IPH register and a description of its bits is shown in
Figure 37.
The function of the IPH SFR, when combined with the IP SFR,
determines the priority of each interrupt. The priority of each
interrupt is determined as shown in the following table:
PRIORITY BITS
INTERRUPT PRIORITY LEVEL
IPH.x IP.x
INTERRUPT
PRIORITY
LEVEL
0 0 Level 0 (lowest priority)
0 1 Level 1
1 0 Level 2
1 1 Level 3 (highest priority)
The priority scheme for servicing the interrupts is the same as that
for the 80C51, except that there are four interrupt levels rather than
two (as on the 80C51). An interrupt will be serviced as long as an
interrupt of equal or higher priority is not already being serviced. If
an interrupt of equal or higher level priority is being serviced, the
new interrupt will wait until it is finished before being serviced. If a
lower priority level interrupt is being serviced, it will be stopped and
the new interrupt serviced. When the new interrupt is finished, the
lower priority level interrupt that was stopped will be completed.
Table 13. Interrupt Table
SOURCE POLLING PRIORITY REQUEST BITS HARDWARE CLEAR? VECTOR ADDRESS
X0 1 IE0 N (L)
1
Y (T)
2
03H
SI01 (I
2
C) 2 N 2BH
T0 3 TP0 Y 0BH
X1 4 IE1 N (L) Y (T) 13H
T1 5 TF1 Y 1BH
SP 6 RI, TI N 23H
T2 7 TF2, EXF2 N 3BH
PCA 8 CF, CCFn
n = 0–4
N 33H
NOTES:
1. L = Level activated
2. T = Transition activated
EX0IEN0 (0A8H)
Enable Bit = 1 enables the interrupt.
Enable Bit = 0 disables it.
BIT SYMBOL FUNCTION
IEN0.7 EA Global disable bit. If EA = 0, all interrupts are disabled. If EA = 1, each interrupt can be individually
enabled or disabled by setting or clearing its enable bit.
IEN0.6 EC PCA interrupt enable bit
IEN0.5 ES1 I
2
C interrupt enable bit.
IEN0.4 ES0 Serial Port interrupt enable bit.
IEN0.3 ET1 Timer 1 interrupt enable bit.
IEN0.2 EX1 External interrupt 1 enable bit.
IEN0.1 ET0 Timer 0 interrupt enable bit.
IEN0.0 EX0 External interrupt 0 enable bit.
SU01454
ET0EX1ET1ES0ES1ECEA
01234567
Figure 35. IE Registers
Philips Semiconductors Product data
P89C660/P89C662/P89C664/
P89C668
80C51 8-bit Flash microcontroller family
16KB/32KB/64KB ISP/IAP Flash with 512B/1KB/2KB/8KB RAM
2002 Oct 28
51
PX0IP (0B8H)
Priority Bit = 1 assigns high priority
Priority Bit = 0 assigns low priority
BIT SYMBOL FUNCTION
IP.7 PT2 Timer 2 interrupt priority bit.
IP.6 PPC PCA interrupt priority bit
IP.5 PS1 Serial I/O1 (I
2
C) interrupt priority bit.
IP.4 PS0 Serial Port interrupt priority bit.
IP.3 PT1 Timer 1 interrupt priority bit.
IP.2 PX1 External interrupt 1 priority bit.
IP.1 PT0 Timer 0 interrupt priority bit.
IP.0 PX0 External interrupt 0 priority bit.
SU01455
PT0PX1PT1PS0PS1PPCPT2
01234567
Figure 36. IP Registers
PX0HIPH (B7H)
Priority Bit = 1 assigns higher priority
Priority Bit = 0 assigns lower priority
BIT SYMBOL FUNCTION
IPH.7 PT2H Timer 2 interrupt priority bit high.
IPH.6 PPCH PCA interrupt priority bit
IPH.5 PS1H Serial I/O (I
2
C) interrupt priority bit high.
IPH.4 PS0H Serial Port interrupt priority bit high.
IPH.3 PT1H Timer 1 interrupt priority bit high.
IPH.2 PX1H External interrupt 1 priority bit high.
IPH.1 PT0H Timer 0 interrupt priority bit high.
IPH.0 PX0H External interrupt 0 priority bit high.
SU01456
PT0HPX1HPT1HPS0HPS1HPPCHPT2H
01234567
Figure 37. IPH Registers
ET2IEN1 (E8H)
Enable Bit = 1 enables the interrupt
Enable Bit = 0 disables the interrupt
BIT SYMBOL FUNCTION
IEN1.7
IEN1.6
IEN1.5
IEN1.4
IEN1.3
IEN1.2
IEN1.1
IEN1.0 ET2 Timer 2 interrupt enable bit.
SU01095
01234567
Figure 38. IEN1 Registers

P89C662HBA/00,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