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: > 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. > > > 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 > mailto:sales@bubblesoftonline.com > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu