beautypg.com

Rainbow Electronics DS2788 User Manual

Page 23

background image

1-Wire Bus System

The 1-Wire bus is a system that has a single bus mas-

ter and one or more slaves. A multidrop bus is a 1-Wire

bus with multiple slaves. A single-drop bus has only

one slave device. In all instances, the DS2788 is a

slave device. The bus master is typically a micro-

processor in the host system. The discussion of this

bus system consists of four topics: 64-bit net address,

hardware configuration, transaction sequence, and

1-Wire signaling.

64-Bit Net Address

Each DS2788 has a unique, factory-programmed

1-Wire net address that is 64 bits in length. The first

eight bits are the 1-Wire family code (32h for DS2788).

The next 48 bits are a unique serial number. The last

eight bits are a cyclic redundancy check (CRC) of the

first 56 bits (see Figure 18). The 64-bit net address and

the 1-Wire I/O circuitry built into the device enable the

DS2788 to communicate through the 1-Wire protocol

detailed in the 1-Wire Bus System section.

CRC Generation

The DS2788 has an 8-bit CRC stored in the MSB of its

1-Wire net address. To ensure error-free transmission

of the address, the host system can compute a CRC

value from the first 56 bits of the address and compare

it to the CRC from the DS2788. The host system is

responsible for verifying the CRC value and taking

action as a result. The DS2788 does not compare CRC

values and does not prevent a command sequence

from proceeding as a result of a CRC mismatch. Proper

use of the CRC can result in a communication channel

with a very high level of integrity.

The CRC can be generated by the host using a circuit

consisting of a shift register and XOR gates as shown

in Figure 19, or it can be generated in software.

Additional information about the Dallas 1-Wire CRC is

available in Application Note 27: Understanding and

U s i n g C y c l i c R e d u n d a n c y C h e c k s w i t h D a l l a s

S e m i c o n d u c t o r i B u t t o n P r o d u c t s (

www.maxim-

ic.com/appnoteindex

).

In the circuit in Figure 19, the shift register bits are ini-

tialized to 0. Then, starting with the LSb of the family

code, one bit at a time is shifted in. After the 8th bit of

the family code has been entered, then the serial num-

ber is entered. After the 48th bit of the serial number

has been entered, the shift register contains the CRC

value.

Hardware Configuration

Because the 1-Wire bus has only a single line, it is

important that each device on the bus be able to drive

it at the appropriate time. To facilitate this, each device

attached to the 1-Wire bus must connect to the bus

with open-drain or three-state output drivers. The

DS2788 uses an open-drain output driver as part of the

bidirectional interface circuitry shown in Figure 20. If a

bidirectional pin is not available on the bus master,

D
S

2

7

8

8

Stand-Alone Fuel-Gauge IC with

LED Display Drivers

______________________________________________________________________________________

23

8-BIT CRC

48-BIT SERIAL NUMBER

8-BIT FAMILY

CODE (32h)

MSb

LSb

Figure 18. 1-Wire Net Address Format

MSb

XOR

XOR

XOR

INPUT

LSb

Figure 19. 1-Wire CRC Generation Block Diagram

iButton is a registered trademark of Dallas Semiconductor

Corp., a wholly owned subsidiary of Maxim Integrated

Products, Inc.