Saving a timestamp from the DS1302
pcrobot
Posts: 103
Hello,
I'm trying to figure out how to save a timestamp from the DS1302 chip. The program to run the clock uses a lot of GOSUBS, which makes it harder to do this, IMO.
Also, for clarity, is the program (the third one in the DS1302's AppKit PDF) supposed to update the debug window? Mine doesn't seem to do that.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
I'm trying to figure out how to save a timestamp from the DS1302 chip. The program to run the clock uses a lot of GOSUBS, which makes it harder to do this, IMO.
Also, for clarity, is the program (the third one in the DS1302's AppKit PDF) supposed to update the debug window? Mine doesn't seem to do that.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
Comments
·· Using the DS1302 in datalogging is pretty painless.· How to store the data depends really on which data you need.· Do you needs hours, minutes and seconds?· Is your datalogging event-related/driven or is it interval-related/driven?· If the later you don't need to store the date and/or time for each sample, only the first, since the others will always be the same time apart and can be easily recalculated.· If the logging is event driven then you need to know over how much time you will log data to decide what timing information is relevant.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
·· There is some DS1302 Demo Code in the Completed Projects Forum.· Using the subroutines in that you could simply call the Get_Time routine (which will also grab the date) and store the variables in EEPROM.· Each one will take one byte, so assuming your sensor data is one byte that's 5 bytes you need to store.· Depending on how many events maximum you expect you can allocate space for storage.
http://forums.parallax.com/showthread.php?p=531080
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
I don't know how you "reset the stamp" but if it involved shutting the power off, and you don't have a back-up batttery installed on the DS1602, that's exactly what you can expect.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
You can RESET the Stamp by bringing the RES pin (pin 22) low, or by cycling the power (OFF then ON) to the Stamp ONLY. Cutting the power to everything will RESET the Stamp, but it will reset everything else as well.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
- All references to resetting the chip refer to the DS1302, not the Stamp
- This document should be reviewed and improved by Parallax. There are several nonsensical/confusing statements that invite misunderstanding. Example on page 2: "Why the power is removed the capacitor/ rechargeable battery will power the DS1302."
·· I don't think you're on the same page.· The PDF you are referring to is already in the process of being re-written.· In the meantime the OP was referred to another link which had more updated information.· Please see one of my first replies.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com