Searching \ for '[PIC]: DS18S20 addressing individual devices' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'DS18S20 addressing individual devices'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: DS18S20 addressing individual devices'
2002\04\09@042158 by Steven Allard

flavicon
picon face
Hello all,

I've built a small project which uses one 18S20, which works well. I am now
trying to write a routine to get the serial numbers of a number of devices
connected to the 1 wire bus.

I'm using C has anyone written some code they are prepared to share, or can
you point me to a good source/webpage ?

Tony Nixon wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\04\10@184013 by Tony Nixon

flavicon
picon face
Steven Allard wrote:
>
> Hello all,
>
> I've built a small project which uses one 18S20, which works well. I am now
> trying to write a routine to get the serial numbers of a number of devices
> connected to the 1 wire bus.
>
> I'm using C has anyone written some code they are prepared to share, or can
> you point me to a good source/webpage ?


This is in assembler, but perhaps you can port it to C without much
bother.

Data in buffer after execution = 8 bytes

Family Code - 1 byte
ID Number   - 6 bytes
CRC         - 1 Byte


       movlw Buffer            ; set buffer pointer
       movwf FSR
       call INITDS             ; start new transaction
       Send_Out Read_ROM       ; read ROM command
GIDLoop call IN_BYTE            ; read bytes
       movwf INDF
       incf FSR
       movlw Buffer + d'8'
       xorwf FSR,W
       btfss STATUS,Z
       goto GIDLoop
       return

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam@spam@bubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\04\10@205750 by Tony Nixon

flavicon
picon face
Tony Nixon wrote:

I forgot to mention that this will only work for 1 device on the bus at
a time. There is a much more complicated procedure to use if multiple
devices are on the bus and need identification, but I haven't used that
method yet.


{Quote hidden}

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam.....bubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\04\11@041532 by Steven Allard

flavicon
picon face
Thanks for the reply Tony

Up until now I've been using a single 1wire device and the ccs c compiler.
I can read, write, get its address and do a crc on the data.

Now, I want to talk to multiple devices.  I have added  3 devices on the
bus to experiment with. I want to read the serial number of each at power
up and then individually address them. The problem is getting their serial
numbers(addresses)

I've read and re-read the dallas datasheet 187 '1 wire search algorithm',
but can't get the code to work, I'm sure this is a hole in my understanding
not in the dallas example code, but I can't help thinking theres a 'neater'
ie shorter, quicker way of doing it.

Regards

Steve

Tony Nixon wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\04\11@081715 by Thomas McGahee

flavicon
face
One way that I handle this problem with some of my homebrew
1 wire devices is to have a simple protocol that allows me
to send out an "are you there" code followed by an address.
If a device with that address is on the bus, then it responds.
The master runs through all possible addresses and takes note
of the valid responses. By the way, it is useful in such a case
to keep the "identity number or address" as simple as possible.
I begin with address 1 and go 2, 3, 4. If I have designed
the system to only have 5 slaves, I only have to test for
1, 2, 3, 4, 5. (I use 0 as a special address that means
ALL slave devices. Useful for when I send a command like
"reset all slaves")

If the number of slaves is 8 or less, then I use an 8 bit
register to keep track of active slaves. Each bit position
represents one of the slaves.

Fr. Thomas McGahee

{Original Message removed}

2002\04\11@115353 by Donovan Parks

flavicon
face
Hello,

If this is a one-of-a-kind product, you could just attach each device to the
bus one at a time, get its address, and then write it down.  You can now
hardcode the three address into your program and don't have to worry about
dynamically determining who is on the bus and what there serial numbers are.
This solution is ideal, IMHO, for a one-of-a-kind project where devices will
not be dynamically added/removed from the bus.

Donovan Parks


{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu


2002\04\11@182444 by Tony Nixon

flavicon
picon face
Donovan Parks wrote:
>
> Hello,
>
> If this is a one-of-a-kind product, you could just attach each device to the
> bus one at a time, get its address, and then write it down.  You can now
> hardcode the three address into your program and don't have to worry about
> dynamically determining who is on the bus and what there serial numbers are.
> This solution is ideal, IMHO, for a one-of-a-kind project where devices will
> not be dynamically added/removed from the bus.


That is what I did for my system. A single sensor is connected and the
host PC software enables the ID to be read and then stored in a small
data base in the PICs EEPROM.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesEraseMEspam.....bubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu


2002\04\15@191502 by Tony Nixon

flavicon
picon face
Thomas McGahee wrote:
>
> One way that I handle this problem with some of my homebrew
> 1 wire devices is to have a simple protocol that allows me
> to send out an "are you there" code followed by an address.
> If a device with that address is on the bus, then it responds.


The trouble with the DS18S20 is that there is a 48 bit ID which would
take some time to sift through on a random basis.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesEraseMEspamEraseMEbubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...