1.2.4 SEARCH ROM Command
The ‘SEARCH ROM’ command can be used when the identifiers of all target devices are not
known in advance. It makes it possible to discover the identifiers of all the targets
present on the bus. First, the ‘SEARCH ROM’ command is transmitted on the bus. Then, the
target reads one bit from the bus. Each target places the first bit of its identifier on
the bus. The target will read this as the logical AND result of the first bit of all
target identifiers. The target then reads one more bit from the bus. Each target then
places the complement of the first bit of its identifier on the bus. The target will
read this as the logical AND of the complement of the first bit of the identifier of all
targets. If all devices have ‘1
’ as the first bit, the target will read
10b. Similarly, if all devices have ‘0
’ as the first bit, the target
will read 01b. In these cases, the bit can be stored as the first bit of all addresses.
The target will then write back this bit, which in effect, will tell all targets to keep
sending identifier bits. If there are devices with both ‘0
’ and
‘1
’ as the first bit in the identifier on the bus, the target will
read 00. In this case, the target must choose whether to continue with the addresses
that have ‘0
’ in this position or ‘1
’. The choice is
transmitted on the bus, in effect making all targets that do not have this bit in this
position of the identifier enter an idle state.
The target then goes on to read the next bit, and the process repeats until all 64 bits are read. The target should then have discovered one complete 64-bit identifier. To discover more identifiers, the ‘SEARCH ROM’ command should be run again, but this time a different choice for the bit value should be made the first time there is a discrepancy. Repeating this once for each target device should discover all targets. Note that when one search has been performed, all targets except one should have entered an idle state. It is now possible to communicate with the active target without specifically addressing it with the ‘MATCH ROM’ command.