Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 resolution — Parallax Forums

DS1302 resolution

OSOKOSOK Posts: 35
edited 2007-07-04 19:52 in BASIC Stamp
First of all, thanks to Mr. Savage for writing those nifty pieces of code showing how to use this IC. It made it very easy to export into other programs...

So, here's my question. I understand the resolution of the chip is 1 sec. But I've come to find that it detects the 'next second' in the .45 mark or so. For example, if I ask it to log for 5 seconds, using something like "IF (secs = 5) THEN EXIT" in a DO loop, I notice it'll exit when about 5.45 seconds have elapsed. I have code for an RPM counter, and I'm just curious if this .45 sec flag is in the chip itself, something with my code, or having to do with the crystal?

Thank you!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-04 19:12
    The DS1302 counts seconds and this count is accurate to roughly the nearest 1/32768 second. Getting the current time out of the device takes a little bit of time and that depends on the specifics of your code. This website (www.emesystems.com) has some excellent information on the speed of the various Stamps for various statements. This may help you figure out where the time went.
  • OSOKOSOK Posts: 35
    edited 2007-07-04 19:52
    Once again, thank you for your help Mike.


    Ignorant me... 1 sec resolution... ha!


    Edit: ok, call me crazy, but I've changed NOTHING in my code and now it stops logging within a 1/10th of a second of the time I tell it to.... no more .45secs after. ????

    Post Edited (OSOK) : 7/4/2007 8:08:19 PM GMT
Sign In or Register to comment.