Reading DS18S20 and DS18B20 In Same Program


Results 1 to 5 of 5

Threaded View

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


    Did you find this post helpful? Yes | No

    Default Re: Reading DS18S20 and DS18B20 In Same Program

    You're welcome Larryd.

    Yes, the rest of the prarameters are still the same.
    Only the pin assignment method changes.

    I had forgotten about that thread.
    But after looking at it again, and since you're using DS1820's ... You might want to set the pins in EEPROM.
    Then the pin assignments can be changed later at Run-Time via a menu or serial commands.

    Maybe somthing like ...
    Code:
    OWpins VAR WORD[10] ; default pins for OneWire commands.
    Sensor0  DATA WORD $0000  ; PORTA.0
    Sensor1  DATA WORD $0001  ;       1
    Sensor2  DATA WORD $0100  ; PORTB.0
    Sensor3  DATA WORD $0101  ;       1
    Sensor4  DATA WORD $0103  ;       3
    Sensor5  DATA WORD $0200  ; PORTC.0
    Sensor6  DATA WORD $0201  ;       1
    Inside   DATA WORD $0204  ;       4
    Outside  DATA WORD $0205  ;       5
    Bedroom  DATA WORD $0206  ;       6
    
    
    Idx  VAR BYTE
    Addr VAR WORD
    
    Addr = Sensor0
    FOR Idx = 0 TO 9          ; Initialize OW pins from EEPROM
      READ Addr + Idx<<1, WORD OWpins(Idx)
    NEXT Idx
    You'll need PBP 2.60 or later.
    Last edited by Darrel Taylor; - 26th January 2013 at 19:42. Reason: Changed Addr for READ ... again
    DT

Similar Threads

  1. ds18b20 not reading on 16f676
    By revelator in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd April 2009, 00:20
  2. DS18B20 VS DS18S20 & multiple
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 7th February 2008, 22:43
  3. DS18S20 reading negative temperature
    By srob in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th December 2007, 21:21
  4. DS18B20 error reading
    By Gaetano in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th August 2007, 16:21
  5. Reading 5 DS18B20 Problem
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2005, 20:51

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