Tag Archives: 24c64

24C1024 I2C EEPROM 128KB

24CXX I2C EEPROM Interface using SoftI2C lib

In this tutorial I will show you how to use our easy to use open source Soft I2C library to access a 24C64 EEPROM chip. We discussed the library in our previous tutorial. The functions developed in this tutorial will use services of the I2C library to read and write the EEPROM. The EEPROM access mainly contains only two routines. BOOL EEWriteByte(uint16_t address,uint8_t data); BOOL EEReadByte(uint16_t address ,uint8_t* data); The first one write a 8 bit data to a memory location specified by the variable address, since a EEPROM can have more that 256 bytes of storage that is why the address variable is 16 bit. The second function reads the memory location specified by the variable address and stores the read data in variable data. Both the function return EE_SUCCESS on success and EE_IO_ERROR on failure. How to develop the EEPROM Write function? We open the datasheet of 24C64A (64kbit) EEPROM and try to understand the random read and random write function. The figure 8 on page number 11 clearly describes the write steps. You just need to translate the figure into proper call to our Soft I2C lib API’s. BOOL EEWriteByte(uint16_t address,uint8_t data) { SoftI2CStart(); //SLA+W if(!SoftI2CWriteByte(EEPROM_WRITE_ADDRESS)) { SoftI2CStop(); //I2C i/o error return EE_IO_ERROR; } //Address HIGH if(!SoftI2CWriteByte(address>>8)) { SoftI2CStop(); //I2C i/o error return EE_IO_ERROR; } //Address LOW […]

Easy 24C I2C Serial EEPROM Interfacing with AVR Microcontrollers

In this turorial we will see how we can easily interface a 24C series serial EEPROM with AVR microcontrollers. What is an EEPROM? An EEPROM is kinds of novalatile memory, that means it is used for storing digital data permanently without any power suply. EEPROM stands for Electrically Erasable Programmable Read Only Memory. The advantage of these kind of ROMs is that they can be erased Electrically to make them ready for storing new data. Compare this with a CD R disks they can be recorded only once. A small amount of EEPROM is also available internally on the AVR chips. So if the volume of data you want to store is small (say few user names and password) then you can use it. The internal eeprom makes design small and simple. But if the amount of data you want to store is large, say in order of few tens of kilobytes then you have to interface a External EEPROM chip with your AVR MCU. You can store pictures, sound and long texts in these eeproms. Their are many kinds of EEPROM chip available from many manufactures. One very common family is 24C series serial EEPROMs. They are available upto 128KB in size. They uses I2C interface with host controller (MCU) which is a very popular serial communication standard. I […]