Problems with 1-Wire DS2438 and PIC16F88


Results 1 to 13 of 13

Threaded View

  1. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Here's an easy way to read the whole page ...

    Using a technique shown here (Typcasting Variables inside of Arrays)

    Code:
    <font color="#000000"><b>DSbuffer  </b><font color="#008000"><b>VAR BYTE</b></font>[<font color="#800000"><b>9</b></font>] <b>BANK0</b>
    <font color="#008000"><b>ASM
    </b></font><font color="#000080">DSstat    = _DSbuffer      </font><font color="#0000FF"><b><i>; byte
    </i></b></font><font color="#000080">DStemp    = _DSbuffer + 1  </font><font color="#0000FF"><b><i>; word
    </i></b></font><font color="#000080">DSvolts   = _DSbuffer + 3  </font><font color="#0000FF"><b><i>; word
    </i></b></font><font color="#000080">DScurrent = _DSbuffer + 5  </font><font color="#0000FF"><b><i>; word
    </i></b></font><font color="#000080">DSthres   = _DSbuffer + 7  </font><font color="#0000FF"><b><i>; byte
    </i></b></font><font color="#000080">DScrc     = _DSbuffer + 8  </font><font color="#0000FF"><b><i>; byte
    </i></b></font><font color="#008000"><b>ENDASM
    
    </b></font><b>DSstat    </b><font color="#008000"><b>VAR  BYTE  </b></font><b>EXT </b><font color="#0000FF"><b><i>; Status/Configuration
    </i></b></font><b>DStemp    </b><font color="#008000"><b>VAR  WORD  </b></font><b>EXT </b><font color="#0000FF"><b><i>; Temperature
    </i></b></font><b>DSvolts   </b><font color="#008000"><b>VAR  WORD  </b></font><b>EXT </b><font color="#0000FF"><b><i>; Voltage
    </i></b></font><b>DScurrent </b><font color="#008000"><b>VAR  WORD  </b></font><b>EXT </b><font color="#0000FF"><b><i>; Current
    </i></b></font><b>DSthres   </b><font color="#008000"><b>VAR  BYTE  </b></font><b>EXT </b><font color="#0000FF"><b><i>; Threshold
    </i></b></font><b>DScrc     </b><font color="#008000"><b>VAR  BYTE  </b></font><b>EXT </b><font color="#0000FF"><b><i>; CRC</i></b></font>
    Then you can read page 0 like this ...<table><tr><td>
    Code:
    <font color="#008000"><b>OWOUT </b></font><b>DQ_Pin</b>,<font color="#800000"><b>1</b></font>,[<font color="#800000"><b>$CC</b></font>, <font color="#800000"><b>$B8</b></font>, <font color="#800000"><b>$00</b></font>] <font color="#0000FF"><b><i>' Skip ROM search, Recall Memory page 0
    </i></b></font><font color="#008000"><b>OWOUT </b></font><b>DQ_Pin</b>,<font color="#800000"><b>1</b></font>,[<font color="#800000"><b>$CC</b></font>, <font color="#800000"><b>$BE</b></font>, <font color="#800000"><b>$00</b></font>] <font color="#0000FF"><b><i>' Skip ROM search, Read page 0
    </i></b></font><font color="#008000"><b>OWIN  </b></font><b>DQ_Pin</b>,<font color="#800000"><b>2</b></font>,[<font color="#008000"><b>STR </b></font><b>DSbuffer</b>\<font color="#800000"><b>9</b></font>]<font color="#0000FF"><b><i>' Read 9 bytes</i></b></font>
    </td><td valign=top><br><br>Recall Memory added: see next few posts.</td></tr></table>
    After reading, all the values will be in the correct variables, with the correct size (word/byte), ready to be used.

    hth,
    Last edited by Darrel Taylor; - 22nd May 2009 at 01:22. Reason: Recall

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts