Shop OBEX P1 Docs P2 Docs Learn Events
Need a little help. — Parallax Forums

Need a little help.

Donny23Donny23 Posts: 8
edited 2013-08-02 11:18 in BASIC Stamp
Is there an easy way way to write my ds1302 elapsed time to the eeprom and simply retrieve the data to view in debug/serial port via reset switch? There will be several times to retrieve.
Using the BS2.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-08-01 22:47
    Look at the READ and WRITE statements in the "Basic Stamp Syntax and Reference Manual". These are used to read and write data from/to the EEPROM. Keep in mind that EEPROM has limited capability for writing. Typically you can change a location about 100,000 times. That may seem like a lot, but it depends on how often you update it. The DS1302 has 31 bytes of RAM which would be a much better place to keep your elapsed time information. As long as you have a backup battery (see the DS1302 datasheet for information on this), the DS1302 will keep the correct time and maintain the RAM contents while the power to the Stamp and other circuitry is off.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-08-02 11:18
    I would recommend using the RAM on the DS1302 for this information. You can back it up with a coin cell battery and write to it as often and as much as you want. If you need examples of writing to the RAM, please see the following link.

    http://www.savagecircuits.com/ds1302
Sign In or Register to comment.