View Full Version : DS1302 writing time
03-23-2010, 01:31 AM
I have a small problem,
I'm measuring time with a DS1302 time keeping chip, but I only know how to write the measured times into it's intern 31 bytes RAM memory.
I want to write the measured times into the EEPROM of the Basic Stamp 2.
Does anyone know how to do this?
03-23-2010, 02:31 AM
Read the chapters in the "BASIC Stamp Syntax and Reference Manual" on the READ, WRITE, and DATA statements. This is included in the help files of the Stamp Editor if you don't otherwise have a copy.
Remember that the EEPROM has a limited lifetime (about 100,000 write cycles for any one location)
03-23-2010, 05:26 AM
You mean that you can rewrite any location in the EEPROM for 100.000 times?
03-23-2010, 09:35 AM
Yes, and then that location "wears out" and will start returning all one's, no matter what you write to it.
So be careful.
03-23-2010, 11:53 AM
The 100,000(One Hundred thousand) write cycle to the EEPROM....Is that all their EEPROM's, I use the BS2e(Interpreter) for now but want to move up to the 48 pin Interpreter. Do the same standards apply?
thanks for the help.
Is there any that has more?
I'M STILL LEARNING SO MUCH...BUT STILL KNOW SO LITTLE!!!
03-23-2010, 08:07 PM
If you have any spare pins you could use an external EEPROM like the 24LC256 (I2C) or the 25LC256 (SPI 3-wire interface, same as the DS1302) which are rated for 1,000,000 read/write cycles. This article (http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/code/nv88.zip)on data logging uses the 24LC256 EEPROM but with an I2C clock chip (PCF8583) instead of the DS1302. Depending on which stamp you're using you may be better off going with I2C as the BS2p, -pe and -px have built-in I2C commands. Using I2C on the BS2 gets a little code heavy because of the subroutines necessary to perform the I2C communications. The 25LC256 pairs up nicely with the DS1302 since they both use shiftin/shiftout. Either way, if you did manage to wear out these EEPROMs you can easily replace them.