TWIPROM - I2C Library for 24LC256

Here it is, there are a lot of code available for this kind of chip, but actually no one handles the full 256kb array..

Documentation on the Playground.

I just need to debug the read_buffer method, to optimize the time needed to read the whole crap, and to define the maximum capacity of the buffers.

FYI, the address lines are typically hard wired (to Vcc or GND) to a certain address. This allows you to use 8 (or 4, if they're the 24xx1025 flavor) devices on the same bus, and it doesn't tie up three digital pins on the arduino.

-j

Ok, but why spend 8 times the price of a chip when you can buy only one and use all its capacity?

hmm.. this is interesting. On one project I am working on, I am running out of flash space and was thinking about interfacing with an external eeprom. I don't really understand what the advantage of changing the address is. I thought the address only matters when trying to communicate to multiple devices on the same bus, so the bus knows which device you are trying to communicate with.

Does changing the address on the EEPROM give you access to more memory? Also does this mean, if I use this method, I won't be able to access any more devices on the I2C bus?

Ok, but why spend 8 times the price of a chip when you can buy only one and use all its capacity?

You are confused as to the purpose of the A0 - A2 inputs.

Changing the I2C address of a 24xx256 (or 24xx512) does not give you access to any more memory. The 3 bits of the address determined by A0 - A2 simply determines the I2C address of that device and allows you to use multiple devices on a single I2C bus. A0 - A2 have nothing to do with the memory being addressed internally.

If you think you are getting 8x the storage, I highly recommend that you run some tests that write unique values to those “8” devices and see how much of it you can read back.

In the case of the 24xx1025 series, the 16 bit address in the protocol is insufficient to address the 128kbytes on the device, so they use two different I2C addresses to address the device. 2 bits of the I2C address are determined by A0 and A1 just like the smaller devices in the series; the other bit of the I2C is used as a “bank select”. Because of this, you can only use 4 of the 24xx1025 devices on one bus (software-wise, it’s exactly the same using four 24xx1025 or eight 24xx512).

Does changing the address on the EEPROM give you access to more memory?

no.

-j

I think I may have identified the source of the confusion: Microchip, like many memory manufacturers, give the number of [u]bits[/u] of memory in the device, not the number of bytes (even though that's how we generally use them).

From the datasheet:

The Microchip Technology Inc. 24AA256/24LC256/24FC256 (24XX256*) is a 32K x 8 (256 Kbit) Serial Electrically Erasable PROM

256k bits, 32k bytes.

-j

Ah, ok, I made a confusion between bits and bytes... autant pour moi.

Ah, ok, I made a confusion between bits and bytes... autant pour moi.

So what is going to happen to your playground posting? ;)

Lefty

Blow some dust off the thread... :o

I am hoping to use my 24LC256 on an arduino/XBee datalogger, but dont find much on this chip.

Any help appreciated. :)

I went into the playground and put a few notes in there warning people.

Have added an explanation of 24LC256 to chapter 21 of my Arduino tutorials here - http://wp.me/pQmjR-16p