Simple and Working Circuit to Control a 24C04 IC Using Arduino (Part 1 of 7)
24C04 is a serial electrically erasable and programmable read-only memory (EEPROM) which provides 512 bytes (512 * 8 = 4096 bits) of memory. Microcontrollers on various arduino boards have different amounts of EEPROM. ATmega328 has 1024 bytes of memory. ATmega168 and ATmega8 have 512 bytes of memory. Similarly, ATmega1280 and ATmega2560 has 4096 bytes (4 KB) of memory. We had already seen the tutorial of writing and reading data in this built in EEPROM. But, this EEPROM memory has a specified life of 100,000 write/erase cycles, so we need to be careful about how often we write to it. To avoid this problem, we are using external EEPROMs like 24C04, 24C08 and 24C16. These ICs are highly reliable and provides an endurance of 1 million write cycles. Since it works based on the I2C protocol, only two digital pins of arduino board is required to read and write data to 24C04. A circuit for writing and reading data from 24C04 is shown below.
From the circuit it is clear that, we need only a little time to complete such a circuit. But, we have to spend a lot of time to develop a program to write and read data to the 24C04. Programming arduino for 24C04 is a bit complicated and you must read the datasheet of 24C04 which will give you a clear idea about the working of 24C04. I spend around one month to analyse the datasheet and to develop the program. So, if you find it difficult to understand the datasheet during initial reading, don’t left it. Try to spend more and more time for the datasheet.
Pin out Diagram of 24C04
Arduino program to write 170 (1 0 1 0 1 0 1 0) in the 3rd memory byte (total 512 bytes) of 24C04 is given in the next part.