EEPROM Interfacing With Microcontroller
EEPROM Interfacing With Microcontroller
1 EEPROM
EEPROM
This type works in different phases. Address phase, data phase and op-code phase are the three
phases in which this chip functions. Some of the common types of serial interfacing are UNI/O,
1-wire, SPI, microwire and I2C.
PARALLEL BUS
For total handling of memory it has a wide address bus and also a data bus consisting of 8 bits.
Parallel built in eeprom is present in many microcontrollers.
parallel EEPROM
The storage transistor traps the electrons as it consists of the floating gate (floating gate is a
transistor that can hold an electrical charge). And in the operation, access transistor is used. As
soon as the electrons leave the floating gate, a cell is erased in case of EPROM, but in EEPROM
if the electrons are trapped in floating cell then the cell will be erased
EEPROM INTERFACING WITH MICROCONTROLLERS
The interfacing of EEPROM with microcontrollers is mostly done through I2C. I2C is known as
the master-slave protocol. There are two signals of I2C, a clock signal and a data signal. Clock
signal SCL is controlled by the Master. The transfer of data occurs through the manipulation of
clock signal. The same clock controls all the slaves connected with the master. The figure below
shows the interfacing with microcontrollers:
interfacing-i2c-eeprom-to-microcontroller
We can connect a number of slave devices with the master IC. Every slave has a unique address,
the master device also contains an address. The slave device could be an LCD, a keyboard, a
clock, a thermometer or a memory interface. The I2C controller used here will work as a master
device and the EEPROM will act as slave. A set of control signals is sent for read or write
operations. These control signals include address bits and data bits. Proper clock signals
accompany these control signals.
AT24C02 is a serial EEPROM by ATMEL. It consists of two wire 2k bits. There are 8 bit
addresses used for the addressing of memory. The memory is so organized that in a single byte
256 words are present, these are arranged in 32 pages and each page contains 8 bytes.Let us take
a circuit which demonstrates the interfacing of 8051 microcontroller with AT24C02. The
microcontroller will perform a write operation and then it will read it also. The results will be
displayed on LCD.
PIN DESCRIPTION OF 24C02 EEPROM
The first three pins are the address pins. As in a system multiple devices can be connected
therefore they need proper addressing. These address pins are either connected with the source
Vcc or with the ground permanently in a circuit. In this specific circuit the address is 000
because all the pins are connected to ground.
2. GND:
This pin must be connected to ground or 0 potential. It is the 4th pin of the IC.
3. SDA:
SDA is the serial data pin. It is a bidirectional pin. The data and the control bits are serially read
or write through this pin. It is the 5th pin of the IC.
4. SCL:
SCL is the clock signal pin. For the transmission of data from the SDA pin a clock signal is
required for each bit transfer. A negative edge transfers data from the EEPROM and a positive
edge carries the data to the EEPROM. It is the 6th pin of the IC.
In the circuit, the bit 0 of port P1 is connected to SDA and pin 1 of port P1 is connected to SCL.
5. WP:
It is the Write Protect pin. If a high signal is given to it, the IC is protected from any write
operation. And if a low signal is given to it, then the read and write operations are allowed
normally. It is the 7th pin of the IC.
For the normal working, the WP pin is connected to ground in the circuit.
6. Vcc:
Vcc is the DC power supply for the 24C02. It is the 8 th pin that must be connected to 5V. Without
this DC supply, the IC will not work.
The device addressing scheme of 24C02 is shown in the figure below. It consists of 8 bits (1
byte). The first 4 bits are fixed sequence bits, then the next 3 bits are the address bits which
indicate the address of the device and finally the last bit indicates whether a read or a write
operation is to be performed.
EEPROM
The figure below shows how microcontroller is interfaced with EEPROM. An lcd displays the
output results.
The circuit diagram shows the complete connections between 24C02 and 89C51. A 12MHz
crystal is also connected between then pin 18 and 19 to provide the clock for the functioning of
microcontroller. The address pins of 24C02 have been grounded to give the address 000. Vcc of
5V is given at the 8th pin and the pins SDA and SCL are connected to the microcontroller for the
transmission of data and clock signals.