www.latticesemi.com
1
rd1006_01
I
2
C Controller
for Serial EEPROMs
July 2001 Reference Design RD1006
Introduction
The I
2
C bus provides a simple two-wire means of communication. This protocol is used in many applications.
SDRAM modules implement a serial EEPROM that supports the I
2
C protocol. This is used so that a microproces-
sor can read the EEPROM for configuration purposes.
This reference design documents an I
2
C Controller designed to interface with serial EEPROM devices. It is
intended to be a simple controller providing random reads cycles only. Typically, serial EEPROMs are programmed
at board assembly time and store configuration information, which is read by a microprocessor during power-up.
This design was implemented in Verilog, synthesized and fitted using Lattice’s ispDesignEXPERT™ software into a
ispMACH™ 4A device. The design requires 46 macrocells and 24 I/O pins. Using an M4A-64/32-55 yields greater
than 153MHz performance. Results may vary according to the synthesis tool.
This design assumes the user has experience with I
2
C controllers. Information available in documents listed in the
Applicable Documents section, below, is not repeated in this document.
Applicable Documents
• National NM24C16 16,384-Bit Serial EEPROM
• Philips I
2
C Specification
• Lattice Semiconductor Data Book CD-ROM
Theory of Operation
Overview
This I
2
C controller provides an interface between standard microprocessors and I
2
C serial EEPROM devices. It
supports random read cycles only. The design consists of the following modules:
• I2c_sep Top level module
• I2c_clk Clock generation module
• I2c_rreg Read register module
• I2c_st State machine module
• I2c_tbuf Tri-state buffer module
•I2c_wreg Write register module
Top Level Signal Description
Table 1 provides the input/output signals of the I
2
C Controller. Signals ending with “_L” indicate an active low signal.
This convention is used throughout the design. The chip select signal is assumed synchronous to the clock.
Address, data and the read/write signals are assumed valid at the assertion of the chip select.
Register Description
Table 2 lists the I
2
C Controller registers.