beautypg.com

1 accelerated rom searc, 1 accelerated rom search example -8, Maxq family user’s guide – Maxim Integrated MAXQ Family User Manual

Page 137: 1 accelerated rom search example

background image

13.5.1 Accelerated ROM Search Example

The following example should provide a better understanding of how the Search ROM Accelerator functionality allows the 1-Wire

Master to identify four different devices on the 1-Wire bus with ROM IDs as shown (least significant bit first):

ROM1 = 00110101....

ROM2 = 10101010....

ROM3 = 11110101....

ROM4 = 00010001....

1)

The host issues a reset pulse by writing 01h to the Command Register. All slave devices respond simultaneously with a presence

detect.

2)

The host issues a Search ROM command by writing F0h to the Transmit Buffer. The host must wait for RBF flag and read (empty)

the Receive Buffer.

3)

The host places the 1-Wire Master in Search ROM Accelerator mode by writing 02h to the Command Register.

4)

The host writes 00h to Transmit Buffer and reads the return data from the Receive Buffer. This process is repeated for total of 16

bytes. The data read contains ROM4 in the ID bit locations and the discrepancy flags d

0

and d

2

are set. This can easily be seen

by examining the ROM IDs bit by bit. The first discrepancy occurs in bit position 0 (d

0

). The bus master write time slot contains a

0, thus deselecting ROM2 and ROM3. A discrepancy between ROM1 and ROM4 then occurs in bit position 2 (d

2

), leaving only

ROM4 in the search. The receive data is as follows (d

0

ID

0

d

1

ID

1

d

2

ID

2

d

3

ID

3

d

4

ID

4

d

5

ID

5

d6ID

6

d

7

ID

7

....):

Receive Data =

10 00 10 01 00 00 00 01....

5)

The host then deinterleaves the data to arrive at a ROM ID of 00010001... and discrepancy data

(bold) of 10100000....with the last

discrepancy at location d

2

.

6)

The host writes 0x00h to the Command Register to exit accelerator mode. The host is now free to send a command or read data

directly from this device.

7)

Steps 1 to 6 are now repeated to find the next device on the bus. The 16 bytes of data transmitted this time are identical to ROM4

up until the last discrepancy flag (d

2

in this case), which is inverted, and all higher order decision discrepancy data bits are set to

0 as shown: r

0

r

1

r

2

r

3

r

4

r

5

....= 001000..... For this search iteration, the receive data contains ROM1 in the ID bit locations, again with

discrepancy flags d

0

and d

2

set.

Receive Data =

10 00 11 01 00 01 00 01....

8)

Since the most significant discrepancy (d

2

) did not change, the next highest discrepancy (d

0

) is used for the next search

r

0

r

1

r

2

r

3

r

4

r

5

....=100000.....

Receive Data =

11 10 01 00 01 00 01 00....

Deinterleaving yields a ROM ID of 10101010.. (ROM2) and discrepancy flags of 11000000.. (d

1

is the most significant flag).

9)

The next search uses the ROM ID acquired in the previous search up until the most significant discrepancy:

r

0

r

1

r

2

r

3

r

4

r

5

....=110000...

Receive Data =

11 11 01 01 00 01 00 01....

Deinterleaving yields a ROM ID of 11110101.. (ROM3) and discrepancy flags of 11000000.. (d

1

is the most significant flag).

10) At this point, the most significant discrepancy (d

1

) did not change so the next highest discrepancy (d

0

) should be used. However,

d

0

has now been reached for the second time, and since there are no lesser significant discrepancies possible, the search is com-

pleted and all four devices are identified.

13-8

MAXQ Family User’s Guide

Maxim Integrated