more-than-8 bit temperature sensor I2C


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default more-than-8 bit temperature sensor I2C

    When using I2CREAD or I2CWRITE with a temp sensor that gives data measurements of more than one byte in length, does using a word size VAR automatically send a second address to the device (which I don't want to do), or how does one acquire a 2-byte data word at a single "address"?

    (specifically, using the TCN75A temp sensor chip)

    Thanks,

    -------------------Picster---------------------

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    I'm using the DS18S20 and it uses two bytes that I place into a word variable.

    If you need to read two seperate bytes into one word variable try this:

    temp var WORD

    [temp.Lowbyte,temp.Highbyte]

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Are those two bites at one "address" location on the device?

    --------------Picster------------

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    "Are those two bites at one "address" location on the device?"

    What is happening is the data starts at the specified address and then read two bytes in a row. My datasheet has byte0 and byte1 listed. Page 11 of your datasheet shows the bit pattern which indicates that the data is two bytes long.

    If you want to try to read a whole word in one shot you can:

    temp var WORD

    [temp]
    Last edited by DynamoBen; - 13th March 2006 at 20:34.

Similar Threads

  1. How do I use 10 bit A/D on 8 bit Pic? 12F675
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 1st April 2020, 20:10
  2. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  3. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 10:38
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 1

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