2 wire sensor problem


Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89

    Unhappy 2 wire sensor problem

    I attempt to read ds1621 with pic16f877A, but always reading 00 value;
    Where is mistake ? Please .....

    ' pic16f877a

    DEFINE OSC 4
    INCLUDE "MYLCD.BAS" ' lcd on portb
    CMCON = 7
    ADCON1 = 7

    SCL VAR PORTD.2
    SDA VAR PORTD.3

    ;( A0,A1,A2 = gnd )

    W0 var word
    ds var byte
    Startconvert var byte

    Startconvert = $EE ' Initiates temperature conversion.
    ds = %10100000 ' device address


    start:
    i2cwrite SDA,SCL,ds,$AC,[0] ' Access Config
    pause 100
    i2cwrite SDA,SCL,ds,Startconvert ' Start Conversion
    pause 750
    gosub gettemp
    lcdout $fe,1
    lcdout "Temperature = ",dec2 W0

    pause 800
    goto start



    gettemp:
    i2cread SDA,SCL,ds,$AA,[W0] ' Read last converted temperature value from temperature register.
    W0 = W0 >> 8
    return
    Attached Images Attached Images  
    Last edited by precision; - 2nd April 2007 at 14:04.

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. how? 2 wire lcd with pbp?
    By nimonia in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 20th October 2005, 07:41
  5. Help LCD with 2 wire Connect (Idea)
    By jetpr in forum Schematics
    Replies: 10
    Last Post: - 18th August 2005, 06:46

Members who have read this thread : 0

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