Shop OBEX P1 Docs P2 Docs Learn Events
Dallas Semiconductor DS1302 — Parallax Forums

Dallas Semiconductor DS1302

ArchiverArchiver Posts: 46,084
edited 2001-05-09 15:22 in General Discussion
Would anyone happen to have some code on this time keeping chip. I
have the time of day and the day of the week squared away but am
having some difficulty with the month day and year. I am using this
to attach to a pressure reading and store about 30 of them so I will
no what day the readings were taken. Is this the best way to do this?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-05-09 15:22
    If the readings are at a predetermined rate (i.e. if you take a
    pressure reading every hour) you only need to know the start time and
    the interval between readings. It would simplify the code, although
    it would require more work to interpret the data.

    If you set the DS1302 to use clock/calendar burst mode, you can
    sequentially read the next 7 bytes, starting with seconds. If you can
    get the the time and day, the month and year should be the same.
    Parallax has created an App Note for the DS1302 and is available in
    the downloads section. It has detailed code for reading and
    formatting the data from the DS1302. (Check their downloads section).

    A similar chip to the DS1302 is the DS1307 which is a 2-wire device.
    I have created a tutorial for using the DS1307 chip at:
    http://www.High-TechGarage.com/tutorial/ds1307.php. You may also be
    interested in a BS2 enhancement (the TimeKeeper) which has a DS1307
    and up to 256K EEPROM for data logging. Best of all, the TimeKeeper
    fits underneath your BS2 and can be powered by the STAMP's voltage
    regulator.

    Good luck,
    --Jeff Wallace
    --Add a RTC, EEPROM and an I2C bus to your BS2
    --www.high-techgarage.com/products/timekeeper.php


    --- In basicstamps@y..., ricky@m... wrote:
    > Would anyone happen to have some code on this time keeping chip. I
    > have the time of day and the day of the week squared away but am
    > having some difficulty with the month day and year. I am using
    this
    > to attach to a pressure reading and store about 30 of them so I
    will
    > no what day the readings were taken. Is this the best way to do
    this?
Sign In or Register to comment.