![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_399.png)
IDT I2C Bus Interface
I2C Bus Master Interface
79RC32438 User Reference Manual
15 - 5
November 4, 2002
Notes
I
2
C Bus Master Interface
The I
2
C bus master interface operates by having the CPU issue commands to the I
2
C bus master
command (I2CMCMD) register and obtaining status from the I
2
C bus master status register (I2CMS). All of
the bits in the I2CMS register, which are not masked by the I
2
C bus master status mask (I2CMSM) register,
are ORed together and presented as the I
2
C bus master interface interrupt. I
2
C bus master commands are
summarized in Table 15.2.
2
Each command in this table consists of a simple action performed on the I
2
C
bus. Commands may be composed sequentially to perform complex I
2
C bus transactions.
2
DIV
Description:
Clock Prescalar Divisor.
The internally generated I
2
C bus prescalar clock is equal to the
IPBus
clock
divided by the DIV field. The I
2
C data transfer rate may be calculated as follows:
I2C transfer rate =
IPBus clock
frequency
÷
I2CCP
÷
8
When the DIV field is equal to zero or one, the I
2
C bus prescalar clock is stopped, and both the
master and slave interfaces are held in reset. Starting or stopping the clock always occurs
cleanly, but the clock may glitch when the period is modified. Therefore, the clock should be
stopped before modifying the period.
Initial Value:
0x0
Read Value:
Previous value written
Write Effect:
Modify value
Command
Encoding
Mnemonic
Description
0000
NOP
No Operation
. Release I
2
C bus and put master transmitter into idle state. When
this command is issued the SDA and SCL signals are tri-stated. This command
completes when a new command is written to the I2CMCMD register.
0001
START
Start
. Wait for any alternate bus master transaction to complete, then generate a
START condition on the I
2
C bus. When this command completes the D bit is set.
For more information on the D bit, refer to the I2C Bus Master Status Register
section later in this chapter.
0010
STOP
Stop
. Generate a STOP condition on the I
2
C bus. When this command com-
pletes, the D bit is set. Unlike other commands which suspend the I
2
C bus when
the D bit is set, the completion of the STOP command sets the
2
D bit but does not
suspend the I
2
C bus. The completion of the STOP command is automatically fol-
lowed by a NOP command.
0011
Reserved
Same effect as NOP.
0100
RD
Read Data
. Receive 8-bits of data from the I
2
C bus and store it in the I2CDI reg-
ister. When this command completes the D bit is set and the NA, LA, and ERR
status bits are valid.
0101
RDACK
Read Data and Acknowledge
. Receive 8-bits of data from the I
2
C bus and store
it in the I2CDI register. After data has been received, generate an acknowledge.
When this command completes the D bit is set and the NA, LA, and ERR status
bits are valid.
Table 15.2 I2C Bus Master Interface Commands (Part 1 of 2)