Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 writing time — Parallax Forums

DS1302 writing time

seppe.ramaekersseppe.ramaekers Posts: 2
edited 2010-03-23 12:07 in BASIC Stamp
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?

Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-22 18:31
    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)
  • seppe.ramaekersseppe.ramaekers Posts: 2
    edited 2010-03-22 21:26
    Thanks!

    You mean that you can rewrite any location in the EEPROM for 100.000 times?
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-03-23 01:35
    Yes, and then that location "wears out" and will start returning all one's, no matter what you write to it.

    So be careful.
  • hmlittle59hmlittle59 Posts: 404
    edited 2010-03-23 03:53
    Hello Mike,

    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?

    Howard

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'M STILL LEARNING SO MUCH...BUT STILL KNOW SO LITTLE!!!

    hmlittle59
  • whyrnutzwhyrnutz Posts: 11
    edited 2010-03-23 12:07
    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 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.

    Tom
Sign In or Register to comment.