Shop OBEX P1 Docs P2 Docs Learn Events
Objects for real time clocks, RTC DS1307, etc. Anybody know? — Parallax Forums

Objects for real time clocks, RTC DS1307, etc. Anybody know?

ElectricAyeElectricAye Posts: 4,561
edited 2008-08-27 20:30 in Propeller 1
Hi all,
Lately I've become obsessed with putting a RTC onto my Propeller. I've decided that I can't live without it. But I can't find any objects that work with chips like the DS1307, etc. Anyone have any suggestions? Know of any postings that my search has failed to find? I don't have any cogs to spare and I'd like about 10 seconds accuracy per month.

thanks,
Mark

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2008-08-26 17:12
    There is an object for the ds1307 in object exchange but I dont think that the ds1307 will give you that level of accuracy. I use the ds3231 which has a higher level of accuracy. You will need to check the data sheets to gauge the level of accuracy e.g. ds3231 says +-2ppm from 0 to 40degree C, therefore seconds in 1 mon = 60*60*24*30 = 2592000 @ +-2ppm gives an error of 5.2sec so in theory within your range. If the temp range is higher then the error is higher. I have an object for the ds3231 which I haven't posted but I can if you are interested. It is based on the ds1307 object but I had to change 1 thing to make it work correctly.

    Both the DS1307 or the ds3231 use the existing cog while accessing the device.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-26 17:30
    Thanks, Timmoore, now I think I see it. It's labeled as i2cObjectv2 and I found it in the "sensor" category. I'll give it a try.

    cheers,
    Mark

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    It might be the Information Age but the Eon of Ignorance has yet to end.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-26 23:17
    Tim,
    I noticed that the DS3231 is a soic. Did you solder this yourself or does somebody out there have some kind of a doo-hickey makes it easy to hook up without an electron microscope?

    thanks,
    Mark

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    It might be the Information Age but the Eon of Ignorance has yet to end.
  • TimmooreTimmoore Posts: 1,031
    edited 2008-08-26 23:50
    I soldered it to a breakout board. The trick I found that works, its to be careful soldering 2 corners to make sure its square, then solder the rest of the pins without worrying about too much solder, then use solder wick to pickup all the surplus solder,
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-27 00:49
    Tim,
    I'm very impressed. I didn't know soldering soics was even humanly possible. Now I want one, too. And you say you have an object tweaked to utilize this DS3231? Now, would you be willing to stand up and share it with the rest of the class?


    Mark

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    It might be the Information Age but the Eon of Ignorance has yet to end.
  • TimmooreTimmoore Posts: 1,031
    edited 2008-08-27 01:26
    Here you go, its almost the same as the ds1307 object you found, just use it in place with the same underlying i2c driver. The only difference is the order of 2 registers is different from the ds1307 object.

    Edit: I just got round to looking at the ds1307 datasheet, and it looks like James had the read/write of day/date in his original object wrong, so the ds1307 and ds3231 objects can be the same but the ds1307 has a bug in setDate/getDate.

    The trick with the soldering isn't mine, if you look on sparkfun.com tutorials they have some good videos showing the trick.


    Post Edited (Timmoore) : 8/27/2008 1:33:11 AM GMT
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-27 01:38
    Tim,
    You The Man!

    Thanks so much!
    Mark

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    It might be the Information Age but the Eon of Ignorance has yet to end.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-27 20:17
    Timmoore,

    I looked at the code for the DS1307 and for your DS3231.· Except for the name of the chip, they look identical.· So are you saying that the error in the DS1307 object is also an error in your DS3231 object?· You suggested that there was an error with the DS1307 setdate/getdate methods.· Can you be more specific?



    thanks,

    Mark
  • TimmooreTimmoore Posts: 1,031
    edited 2008-08-27 20:25
    Look at setdate/getdate - The order of getting/setting date/days are swapped round between the 2 objects.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-08-27 20:30
    Ah-ha!· The ole switch the days with the date trick!· I'm glad you found that; it would have cost me my Labor Day weekend, I'm sure.

    cheers,
    Marksmile.gif
Sign In or Register to comment.