Shop OBEX P1 Docs P2 Docs Learn Events
Reading DS 1822 or DS1820 TH TL flags — Parallax Forums

Reading DS 1822 or DS1820 TH TL flags

ArchiverArchiver Posts: 46,084
edited 2003-10-08 23:07 in General Discussion
I really need some help with the code needed to read the High and Low
temp Flags on these temp sensors I have not been able to find any
documintation for the actual code needed for this chore. I have the
spec sheets and have looked on the parallax sight but no one has
address the specifics of the code needed. when you search for a alarm
according to the flow chart you issue a convert T, then an alarm
search, then you issue a read scratchpad to see if a DS1822 has
issued a rom ser #, which I assume is the alarm code? Maybe?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-10-08 23:07
    I'll nibble....

    I've been using the DS1615 and finding help for these can be tough. How are you
    reading it now? Have any code we can look at?

    Here is how I'd do it....I don't have one of these to play so take this with
    grain of NaCl....[noparse]:)[/noparse]

    First we pulse the data line to tell it to get ready. Pull the dataline low and
    then high.

    Wait till the return pulse done....a pause or maybe a loop to watch the
    Dataline...when it's back to high we are ready to send commands.

    Send the command...I'd use Shiftout. For a bus with many sensors you send out
    the byte for "match Rom" 55 hex....then the 64 bit address....that's 9 bytes
    total. The command might look like this...

    shiftout dataline, sclk, lsbfirst, [noparse][[/noparse]$55,SN1,SN2,SN3,SN4,SN5,SN6,SN7,SN8]

    I'm assuming you can ignore the clock line...no need for it anyway. If you only
    have one device you can skip the rom...via

    shiftout dataline, sclk, lsbfirst, [noparse][[/noparse]$CC]

    Then send out "Read Scratchpad" or BE

    shiftout dataline, sclk, lsbfirst, [noparse][[/noparse]$BE]
    After that 9 bytes are coming your way....so you need to collect them and do
    what you want with them. Your High and low values are byte 2 and 3 if you start
    counting at 0
    I guess shiftin works.....here is something close...

    shiftin dataline, sclk, lsbpre, [noparse][[/noparse]temp1,temp2,TH,TL,crap1,crap2,CR,CP,CRC]

    And there you have it, something to ponder. If you want to log temperature that
    Ds1615 is pretty cool...plus I have working code for it! [noparse]:)[/noparse]

    Good luck,
    Let us know how it goes...
    Tim







    >>> j-beasley@c... 10/08/03 02:41PM >>>
    I really need some help with the code needed to read the High and Low
    temp Flags on these temp sensors I have not been able to find any
    documintation for the actual code needed for this chore. I have the
    spec sheets and have looked on the parallax sight but no one has
    address the specifics of the code needed. when you search for a alarm
    according to the flow chart you issue a convert T, then an alarm
    search, then you issue a read scratchpad to see if a DS1822 has
    issued a rom ser #, which I assume is the alarm code? Maybe?


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.