1 Wire Search Routine


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default 1 Wire Search Routine

    A while back I wrote a bit of code to search a 1 WIRE BUS to find the device rom numbers and store them into ram for future use. Attached is the basic routine I used based on the application notes form Dallas Semiconductor. The storage array can be made larger or smaller as you wish. I have successfully been able to locate upto 32 nodes made up of 5 different types of Dallas products. The only thing needs to be added to the program are the LCD Defines. This was written for a 2 X 40 display connected to a 18F452 @ 40 Mhz. After looking at how many times the attached routine was downloaded I decided to put it in the software section. Hope this helps you 1 wire guy's....

    Dave Purola, N8NTA
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2006
    Location
    Italy
    Posts
    72


    Did you find this post helpful? Yes | No

    Default Re: 1 Wire Search Routine

    Hi, I've no experience in getting the info from more than one sensor, but I've found some other approach to the DS18B20.
    Seems that:

    Code:
    Temp   VAR WORD        
    ID        VAR BYTE[8]       '64 bit memory array
    
    OWOUT Pin, 1, [$33]         'This read the internal eeprom of the sensor
    OWIN Pin, 0,[STR ID\8]      'Save the result into a 8 byte array
    
    SELECT CASE ID[0]
    	CASE $28
    		'a DS18B20 has been found
    		
    	CASE $10
    		'a DS18S20 has been found
    		
    END SELECT
    
    OWOUT Pin, 1, [$CC, $44]                        ' Jump the ROM and convert
    PAUSE 900                                       ' Give enough time for conversion (you could reduce it using 10 bit resolution)
    OWOUT Pin, 1, [$CC, $BE]' Jump the ROM and read
    OWIN  Pin, 2, [Temp.Lowbyte, Temp.Highbyte] ' Read 2 bytes
    As said I've not experience in using more than one of those sensor, but probably there is a way to choose wich one using the data of the internal EEPROM.
    If you get some result, please post your experience for future use.

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: 1 Wire Search Routine

    There might be something of use for you here...
    http://www.picbasic.co.uk/forum/cont...r-nine-of-them
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: 1 Wire Search Routine

    thanks everybody for the assistance.
    I suggest the indication provided by Heckler:
    http://www.picbasic.co.uk/forum/cont...r-nine-of-them

    Thanks again.
    Ambrogio

Similar Threads

  1. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 08:31
  2. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 14:35
  3. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 04:37
  4. one line led light make image
    By bioul in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 13:19
  5. HSERIN doesn´t work
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th July 2007, 15:23

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