Shop OBEX P1 Docs P2 Docs Learn Events
Any Code samples for the DS1921 Thermocron? — Parallax Forums

Any Code samples for the DS1921 Thermocron?

TimCTimC Posts: 77
edited 2006-06-26 04:39 in BASIC Stamp
Hi,
Just got a new BS2px and a cool one wire device that will log temperature changes all on it's own power.

I have the basics down with code that reads the serial number and R/W to the RAM.

I am looking for code samples to help me read/write the time and read the temp.

If someone knows how to set up the logging and read out the results that would be great. I just want the joy of a few programming hurdles in order to complete the project

Thanks
Tim C

Comments

  • TimCTimC Posts: 77
    edited 2006-06-26 04:39
    I was able to answer my own questions. However it did take the whole weekend.
    Turns out I had started a "mission" with my DS1921 last January so it had over 75K data points inside. Here is what I got out of it:
    DS1921L Test
    DS1921L - ROM Information:
    Temp Range code -> 34C
    Serial Number -> 0 00 01 84 EA
    Family Code -> 21
    Read back what was written to DS1921L scratchpad.
    -> 1234567890a
    Address: -> 0 - 10
    Copying DS1921L scratchpad to memory.
    Read DS1921L memory.
    -> 1234567890a
    Current Date/Time:
    -> 06/25/06 23:16:12
    First Mission sample at:
    -> 01/20/05 22:23
    ALL||Current number of mission samples taken for this device:
    -> 124002 || 75030
    Read DS1921L Status Register.
    -> 10100111 Mission IS Running
    Read DS1921L Control Register.
    -> 00001001 RTC Running
    Read the current DS1921L Temperature:
    -> 24C
    Read some Histogram data at around 23C-25C:
    -> 10701 15364 16470 12231 7340

    I should note that others have reported errors in transmission to one wire devices, I did not get any with my 3 foot coiled cable. The code is not tidy but it should help others work with the one wire devices.
    Regards
    Tim
Sign In or Register to comment.