Hi Pic'ers, I am working on a project where I try to use a PIC as a slave device on a 1-wire bus. Most of the stuff is trivial to implement but the ROM SEARCH and ALARM SEARCH functions is a bit hard to code efficiently. For those of you that don't know the 1-wire protocol I will try to explain the behavior. All 1-Wire devices have 64-bit serial number ( actually it consist of a family code ( 1-byte, serial number 6 bytes and a crc 1-byte) but for this discussion its enough to think of all the 64 bits as a serial number. A rom search and an Alarm Search works in the same way. The function byte is sent out. 1.) All devices respond with there LSB bit. 2.) The master does another read and all devices on the bus respond with complement of there LSB bit. so if we have 00 - there are devices on the bus with conflicting bits in this position 01 - all devices on the bus have a 0 in this bit position. 10 - all devices have a 1 in this bit position 11 - there are no devices on the bus. so the master writes out a bit ( 0/1 ) selecting devices it is interested of and continue until all bits have been tested. This is repeated until all devices have been found. A read on the bus is iniated by a short low pulse > 1us from the master after which the slave puts out its bit. A write on the bus works the same way except for a 15 us max initially low pulse. Both a read and a write cycle is about 60 us long. So i have my device address in 8 RAM positions. Have received a SEARCH ROM command. What is the most efficient way to do this on a PIC. /Ake