1 device identification, 2 protocol, 3 rom commands – Matrix Orbital PK202-25 User Manual

Page 34

Advertising
background image

7.1 Device Identification

Each 1-wire device contains a unique 64-bit address in which to identify them with. The address is

guaranteed to be unique from any other device, allowing a virtually unlimited number of devices on to be

attached to the bus. The address itself contains a family code and a cyclic redundancy check (CRC). The

family code is unique to a particular device model. For example, the family code for the DS18S20 temper-

ature probes is 10H. The CRC byte is included as a verification that the correct address was transmitted or

received.

7.2 Protocol

The transaction sequence for accessing a 1-wire device is as follows:

1. Reset and detect presence.

2. ROM command, followed by any required data exchange.

3. Device specific function command, followed by any required data exchange.

Before communication can begin, the bus must be reset to force all devices to begin listening. After the

reset, all the devices will transmit a presence pulse which indicates that there is at least one device on the

bus. Once the presence of at least one device has been confirmed, the master must select which group of

devices will be involved in the rest of the transaction. A device will use a ROM command to determine if the

following transaction is intended for it. If not, the device will ignore all communication on the bus until the

next bus reset. Otherwise, the device will read and process the rest of the transaction. The final part of the

transaction is the device specific function command. To determine what functions the device will respond

to, consult the devices’ data sheet.

It is very important to follow this sequence for every transaction. If any of these steps are omitted or

performed in the wrong order, the devices will not respond.

None of the device addresses are known ahead of time, and as such, each of their addresses must be

searched out and determined. The 1-wire bus provides a means of searching the bus for devices and deter-

mining their address.

7.3 ROM Commands

The ROM commands allow a device to be singled out for communication or all devices to be included.

This manual only presents the three most used ROM commands. For a more detailed listing and description

of all the ROM commands, consult the data sheet for the 1-wire device being used.

Match ROM [55h]: To single out a device, the Match ROM command is used. After this com-

mand has been issued the 64-bit target address is transmitted in LSB to MSB order. Any device with

an address that doesn’t match will ignore all further communication until the next bus reset.

Skip ROM [CCh]: After this command, all devices will continue to listen and process the trans-

action. This is equivalent to broadcasting to all devices. This command is useful when probes need

to be informed to get their measurement ready. With this command all the probes can be instructed

simultaneously.

Matrix Orbital

PK202-25

30

Advertising