24LC32A chip programming
bond999
Posts: 1
.
Post Edited (bond999) : 3/7/2007 11:38:36 PM GMT
Post Edited (bond999) : 3/7/2007 11:38:36 PM GMT
Comments
The 24LC32A is a 4Kx8 EEPROM chip. Most of these articles use a larger chip, like 32Kx8, but the programming is the same, just a smaller number of locations are available.
You can use the "read a byte" and "write a byte" routines from the article I mentioned to copy the data and verify it. Just be sure to wait 5ms ("PAUSE 5") after each write.
I was just suggesting that if bond999 had access to a programmer that he might go that route.· It seems that copying the EEPROMs is his objective.· I don't figure him to be a "Stamper."
_____________________
bond999,
If you decide to buy a Stamp, etc.·to do this, then buy a BS2p, BS2pe, or BS2px because with those you can use the I2CIN and I2COUT commands and that'll make the project ultra-easy.
·
·· Is this a BASIC Stamp-based device?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
You will need a program in the Stamp to read the contents of the 24LC32A EEPROM and copy it to the Stamp's own EEPROM using the WRITE statement (and probably display it on the PC in the process). I think the Nuts and Volts article gives the subroutines to read one location from the EEPROM and some general discussion of what they do and how they work. You will need a second program that will read the data from the Stamp's own EEPROM using the READ statement and copy it to the new 24LC32A EEPROM one byte at a time. Typically, you'll write both programs using Jon Williams' programs as starting points, then download (from the PC) and run (and debug) the first program. Once that's working, you can swap EEPROMS, download the second program and debug it. Once it's working satisfactorily, you'll be able to just restart the Stamp and it will program a new EEPROM from the copy of the data in the Stamp's program EEPROM. The Stamp has a total of 2K of EEPROM and most programs don't occupy the whole thing. When you download a new program from a PC using the Stamp Editor, it leaves the part of the EEPROM untouched that's not occupied by your program. This can be used for data storage as in this case subject to the limitations of EEPROMs in general (mostly limits on how many times you can change a given location ... on the order of 100K to 1 million times).
You will probably want the 4.7K (typical in I2C devices) for pull-ups. A note on the WRITE command though…You won’t be using it in this application. WRITE only affects the internal EEPROM. You can also check the follow sources for additional wiring and code examples for the 24LC32A. Take care.
·
http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv115.pdf
http://www.parallax.com/dl/docs/books/sw/stampworksmanualv1_2.pdf
(See experiment #32, Page 197)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I've rethought this a little and I think a direct copy from one EEPROM to another is in order. You need to connect another 8-pin socket in parallel with the one you currently have with Vss, Vcc, SDA, and SCL all in parallel. All the WP, A2, and A1 pins are connected to Vss. One A0 (the read socket) is connected to Vss. The other A0 (the write socket) is connected to a 4.7K resistor and the other end of the resistor is connected to Vcc. Have a look at page #214 of the Nuts and Volts article (NV115). It has a one byte read routine that will read from address "wrdAddr" into "i2cData" using the "read socket". Here's the code (obviously it relies on a variety of subroutines in Jon's example program on pages 222-224 which will have to be included).
On the previous page, there's an example of writing to a device. I've modified it slightly so it's for another 24LC32A, but with a device address of 1 instead of 0 (since that's how your "write socket" is connected).
The PAUSE is to allow the 24LC32A to finish its write cycle (it takes about 5ms). Note that the EEPROM address (in wrdAddr) is the same in both routines and that the value read with the first routine (i2cData) is used in the second routine to write to the EEPROM. All you have to do to copy the EEPROM is to put these two routines in a loop:
I would suggest you also have a verify program that reads from a location in the first EEPROM, saves the value (i2cData) in another variable, then reads the same location in the second EEPROM (you should be able to figure out how to do that) and compares the two values and, if not equal, displays an error message and stops. If equal, go on to the next location until all are checked.