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
19
Table 3. Serial Clock Rates
6-clock mode
BIT FREQUENCY (kHz) AT f
OSC
CR2 CR1 CR0 3 MHz 6 MHz 8 MHz 12 MHz
2
15 MHz
2
f
OSC
DIVIDED BY
0 0 0 23 47 62.5 94 117
1
128
0 0 1 27 54 71 107
1
134
1
112
0 1 0 31 63 83.3 125
1
156
1
96
0 1 1 37 75 100 150
1
188
1
80
1 0 0 6.25 12.5 17 25 31 480
1 0 1 50 100 133
1
200
1
250
1
60
1 1 0 100 200 267
1
400
1
500
1
30
1 1 1 0.24 < 62.5
0 < 255
0.49 < 62.5
0 < 254
0.65 < 55.6
0 < 253
0.98 < 50.0
0 < 251
1.22 < 52.1
0 < 250
48 × (256 – (reload value Timer 1))
Reload value Timer 1 in Mode 2.
12-clock mode
BIT FREQUENCY (kHz) AT f
OSC
CR2 CR1 CR0 6 MHz 12 MHz 16 MHz 24 MHz
3
30 MHz
3
f
OSC
DIVIDED BY
0 0 0 23 47 62.5 94 117
1
256
0 0 1 27 54 71 107
1
134
1
224
0 1 0 31 63 83.3 125
1
156
1
192
0 1 1 37 75 100 150
1
188
1
160
1 0 0 6.25 12.5 17 25 31 960
1 0 1 50 100 133
1
200
1
250
1
120
1 1 0 100 200 267
1
400
1
500
1
60
1 1 1 0.24 < 62.5
0 < 255
0.49 < 62.5
0 < 254
0.65 < 55.6
0 < 253
0.98 < 50.0
0 < 251
1.22 < 52.1
0 < 250
96 × (256 – (reload value Timer 1))
Reload value Timer 1 in Mode 2.
NOTES:
1. These frequencies exceed the upper limit of 100 kHz of the I
2
C-bus specification and cannot be used in an I
2
C-bus application.
2. At f
OSC
= 12 MHz/15 MHz the maximum I
2
C bus rate of 100 kHz cannot be realized due to the fixed divider rates.
3. At f
OSC
= 24 MHz/30 MHz the maximum I
2
C bus rate of 100 kHz cannot be realized due to the fixed divider rates.
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
20
More Information on SIO1 Operating Modes
The four operating modes are:
Master Transmitter
Master Receiver
Slave Receiver
Slave Transmitter
Data transfers in each mode of operation are shown in Figures 8-11.
These figures contain the following abbreviations:
Abbreviation Explanation
S Start condition
SLA 7-bit slave address
R Read bit (high level at SDA)
W Write bit (low level at SDA)
A Acknowledge bit (low level at SDA)
A
Not acknowledge bit (high level at SDA)
Data 8-bit data byte
P Stop condition
In Figures 8-11, circles are used to indicate when the serial interrupt
flag is set. The numbers in the circles show the status code held in
the S1STA register. At these points, a service routine must be
executed to continue or complete the serial transfer. These service
routines are not critical since the serial transfer is suspended until
the serial interrupt flag is cleared by software.
When a serial interrupt routine is entered, the status code in S1STA
is used to branch to the appropriate service routine. For each status
code, the required software action and details of the following serial
transfer are given in Tables 4-8.
Master Transmitter mode
In the Master Transmitter mode, a number of data bytes are
transmitted to a slave receiver (see Figure 8). Before the Master
Transmitter mode can be entered, S1CON must be initialized as
follows:
S1CON (D8H) CR2 ENS1 STA STO SI AA CR1 CR0
7
6543210
1000X
bit rate
bit
rate
CR0, CR1, and CR2 define the serial bit rate. ENS1 must be set to
logic 1 to enable SIO1. If the AA bit is reset, SIO1 will not
acknowledge its own slave address or the general call address in
the event of another device becoming master of the bus. In other
words, if AA is reset, SIO0 cannot enter a Slave mode. STA, STO,
and SI must be reset.
The Master Transmitter mode may now be entered by setting the
STA bit using the SETB instruction. The SIO1 logic will now test the
I
2
C bus and generate a start condition as soon as the bus becomes
free. When a START condition is transmitted, the serial interrupt flag
(SI) is set, and the status code in the status register (S1STA) will be
08H. This status code must be used to vector to an interrupt service
routine that loads S1DAT with the slave address and the data
direction bit (SLA+W). The SI bit in S1CON must then be reset
before the serial transfer can continue.
When the slave address and the direction bit have been transmitted
and an acknowledgment bit has been received, the serial interrupt
flag (SI) is set again, and a number of status codes in S1STA are
possible. There are 18H, 20H, or 38H for the Master mode and also
68H, 78H, or B0H if the Slave mode was enabled (AA = logic 1). The
appropriate action to be taken for each of these status codes is
detailed in Table 4. After a repeated start condition (state 10H). SIO1
may switch to the Master Receiver mode by loading S1DAT with
SLA+R).
Master Receiver mode
In the Master Receiver mode, a number of data bytes are received
from a slave transmitter (see Figure 9). The transfer is initialized as
in the Master Transmitter mode. When the start condition has been
transmitted, the interrupt service routine must load S1DAT with the
7-bit slave address and the data direction bit (SLA+R). The SI bit in
S1CON must then be cleared before the serial transfer can
continue.
When the slave address and the data direction bit have been
transmitted and an acknowledgment bit has been received, the
serial interrupt flag (SI) is set again, and a number of status codes in
S1STA are possible. These are 40H, 48H, or 38H for the Master
mode and also 68H, 78H, or B0H if the Slave mode was enabled
(AA = logic 1). The appropriate action to be taken for each of these
status codes is detailed in Table 5. ENS1, CR1, and CR0 are not
affected by the serial transfer and are not referred to in Table 5. After
a repeated start condition (state 10H), SIO1 may switch to the
Master Transmitter mode by loading S1DAT with SLA+W.
Slave Receiver mode
In the Slave Receiver mode, a number of data bytes are received
from a master transmitter (see Figure 10). To initiate the Slave
Receiver mode, S1ADR and S1CON must be loaded as follows:
S1ADR (DBH) XGC
7
65 432 10
own slave address
X XXXX X
The upper 7 bits are the address to which SIO1 will respond when
addressed by a master. If the LSB (GC) is set, SIO1 will respond to
the general call address (00H); otherwise it ignores the general call
address.
S1CON (D8H) ENS1 STA STO SI AA CR1 CR0
7
6543210
X1 0001X X
CR2
CR0, CR1, and CR2 do not affect SIO1 in the Slave mode. ENS1
must be set to logic 1 to enable SIO1. The AA bit must be set to
enable SIO1 to acknowledge its own slave address or the general
call address. STA, STO, and SI must be reset.
When S1ADR and S1CON have been initialized, SIO1 waits until it
is addressed by its own slave address followed by the data direction
bit which must be “0” (W) for SIO1 to operate in the Slave Receiver
mode. After its own slave address and the W bit have been
received, the serial interrupt flag (I) is set and a valid status code
can be read from S1STA. This status code is used to vector to an
interrupt service routine, and the appropriate action to be taken for
each of these status codes is detailed in Table 6. The Slave
Receiver mode may also be entered if arbitration is lost while SIO1
is in the Master mode (see status 68H and 78H).
If the AA bit is reset during a transfer, SIO1 will return a not
acknowledge (logic 1) to SDA after the next received data byte.
While AA is reset, SIO1 does not respond to its own slave address
or a general call address. However, the I
2
C bus is still monitored
and address recognition may be resumed at any time by setting AA.
This means that the AA bit may be used to temporarily isolate SIO1
from the I
2
C bus.
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
21
S SLA WA ADATA P
S SLA W
A P
A P
08H
18H
28H
R
38H
A or A
OTHER MST
CONTINUES
A or A
OTHER MST
CONTINUES
38H
30H
20H
68H 78H 80H
OTHER MST
CONTINUES
A
MT
10H
TO MST/REC MODE
ENTRY = MR
TO CORRESPONDING
STATES IN SLAVE MODE
SUCCESSFUL TRANSMISSION
TO A SLAVE RECEIVER
NEXT TRANSFER STARTED WITH A REPEATED START CONDITION
NOT ACKNOWLEDGE RECEIVED AFTER THE SLAVE ADDRESS
NOT ACKNOWLEDGE RECEIVED AFTER A DATA BYTE
ARBITRATION LOST IN SLAVE ADDRESS OR DATA BYTE
ARBITRATION LOST AND ADDRESSED AS SLAVE
A
n
FROM MASTER TO SLAVE
FROM SLAVE TO MASTER
ANY NUMBER OF DATA BYTES AND THEIR ASSOCIATED ACKNOWLEDGE BITS
THIS NUMBER (CONTAINED IN S1STA) CORRESPONDS TO A DEFINED STATE OF THE I
2
C BUS. SEE TABLE 4.
Data
SU00971
Figure 8. Format and States in the Master Transmitter mode

P89C660HBA/00,512

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