Shop OBEX P1 Docs P2 Docs Learn Events
ATTN KYE - DS1307 RTC engine — Parallax Forums

ATTN KYE - DS1307 RTC engine

Ron CzapalaRon Czapala Posts: 2,418
edited 2010-09-10 07:13 in Propeller 1
Kye,
I tried a couple of DS1307 objects but yours was the only one that seemed to work.

I have made a version of your RTC driver which allows setting/reading the DS1307 in 12 hour mode (in addition to 24 hour).
I have other programs (for Basic Stamps and Arduinos) that use 12 hour mode so that is why I wanted to try it in SPIN.

It works great but I have a question.

Your methods have comments like "6 Stack Longs" etc.

What exactly does that mean and how did you calculate the value?

Thanks,
- Ron

Comments

  • KyeKye Posts: 2,200
    edited 2010-09-10 06:48
    Basically that's a stack usage hint to tell you how much stack space calling that function will require.

    So, if you were running out of memory you would have a good idea then of how large the stack needed to be for a cog...

    I calculated that value using the wisdom provided by Chip Gracey in one of the webinars. He said, that every functions needs 3 stacks longs plus one for every local variable and argument. So... using that info I then just built up the stack estimate for each function. You'll find that its in the ball park of how many stack longs each function uses.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2010-09-10 07:13
    Thanks for the explanation Kye.

    I thought maybe you had some sort of analysis program that calculated the memory requirements.

    I might expand this code some more to handle the DS3231 RTC alarm capabilities but there are a lot of options for setting alarms...
Sign In or Register to comment.