PDA

View Full Version : Multiple EEPROM 24LC



alik
- 3rd February 2008, 11:58
I wish to increase the memory capacity in a device by adding multiple eeproms (24LC512), so that when the memory becomes 90% full it switches to the next eeprom by removing the power, i guess i could do this by sharing the sda/scl/gnd with all the eeproms and supply the vcc as a high output from a port on a pic 16f876. the question is what code would i use to know when the memory was 90% full or even 100%.
any help would be appreciated.
Thank you

BobK
- 3rd February 2008, 15:45
Hi Alik,

Some EEPROMs have address inputs such as A0, A1, and A2. These are binary inputs meaning 000 is the first EEPROM, 001 is the second, 010 is the third, 100 is the fourth, 101 is the fifth, 110 is the sixth and 111 is the seventh. So now if you needed alot of memory, you could have up to 7 different EEPROMs on your system. All of these EEPROMs will share the sda,scl,vcc, and vdd pins. You would set the address of each EEPROM by placing vcc or vdd on the appropriate address pins to set each units specific address.

Some EEPROMs have a chip select input. Here you apply usually a low signal to this input to access the locations.

As for how to code each of these you will need to search the forums here as I have seen some examples posted in the past. Your post donesn't say what it is exactly you are doing with the extra memory, being a data logger or what. But something that comes to mind is you could assign through your program certain items be stored in each memory location and your program will keep track of what's store in what memory chip. I kinda got the feeliing you are doing a logger of some sort. I have seen examples where the pic keeps track of how many records have been stored and knowing how many locations are used in each record doing the math, you would then know how many records can be stored on each chip and then you would know when to switch to the next EEPROM. I haven't seen any actual data logger programs on this forum but I have seen one in Nuts & Volts magazine a couple of years ago in the Stamp articles. It shouldn't be too hard to figure out how to do it from there.

If you are able to get a copy of Les Johnson's book, "Experimenting with the PICBasicPro Compiler", there is a section that explains how to work with the different types of Serial EEPROM technologies such as I2C, SPI, and Microwire. Excellent book!

Chuck Hellebuyck's book "Programming PIC Microcontrollers with PICBasic" has an example program using a 16F876 to store data in an external EEPROM. I believe he offers this book for a free download on his site www.elproducts.com.

Hope some of this helps you out.

BobK

tenaja
- 3rd February 2008, 16:20
I wish to increase the memory capacity in a device by adding multiple eeproms (24LC512), so that when the memory becomes 90% full it switches to the next eeprom by removing the power, i guess i could do this by sharing the sda/scl/gnd with all the eeproms and supply the vcc as a high output from a port on a pic 16f876. the question is what code would i use to know when the memory was 90% full or even 100%.
any help would be appreciated.
Thank you
Although I do not know of a way to "automatically" detect when it is full, it should be quite easy. Presumably, if you are building the board and coding the PIC, you know what size the eeprom is and how much you have already written to it. Something simple like this, just before your write command...

if MemoryAddress > $ffff - WRITESIZE then
MemoryAddress = 0
WriteAddress = WriteAddress + 1
if WriteAddress > MaxWriteAddress then goto FullTimeSleep
Endif

alik
- 4th February 2008, 10:24
Thank you for your replies.

Sorry I forgot to mention, it is for an off the shelf data logger and i do not have acces to recode the device, it will only work with the 24lc512, i have tried changing it to a 24lc1025, but the device does not work. so what i need to do is build an external circuit on which to have multiple 24lc512 eeproms and power up one at a time once the previous becomes full, using the high output from a port on the 16f876 as the Vcc for the 24lc512.