AN 486: SPI to I2C Using Altera MAX Series

ID 683611
Date 9/22/2014
Public

1.2. I2C Interface

Altera device acts as a master to the I2C bus.

Because the designs are meant to provide an interface between an SPI master and an I2C device, multi-master support is not provided on the I2C bus.

Table 2.  I2C Interface PinsThe table below describes the I2C interface pin.
Signal Direction Function
SCLK Output I2C serial clock
SDA Bidirectional I2C data bus

The I2C functions are carried out based on the command register value received from the SPI side.

Table 3.  I2C CommandsThe table below describes the significance of the value stored in the command register.
Command Register Data In Register Function on the I2C Line
10000000 Slave address + R/W Start/repeat start
01000000 Data to be written Write a byte
00100000 Don’t care Read a byte
00010000 Don’t care Stop
00000000 Don’t care Null, wait state

The data read in a particular I2C transaction is stored in the data out register and is read by the SPI master in its next SPI transaction. The last command word, 00000000 (b), is required for the SPI master to read the value of status and data out registers without doing anything on the I2C bus.

Figure 3. I2C Command Format