Write status [d2h, Owms register, Wire bus system – Rainbow Electronics DS1957 User Manual
Page 14: Hardware configuration
DS1957
14 of 25
WRITE STATUS [D2H]
The 1-Wire UART Status (OWUS) is the only status byte that can be written by the bus master. It
resembles the counterpart of the OWMS register. The upper four bits of the OWUS are not assigned to
any function. The lower bits, STAT0 to STAT3, are used to pass bit-level information to control the
program flow within the microcomputer. The details on the use of these bits are explained in the “Crypto
iButton Firmware Reference Manual.”
OWMS REGISTER
After the command code for Write Status the bus master transmits the new value of the OWUS byte.
Now the bus master receives the inverted CRC16 of command code and the OWUS byte transmitted.
The bus master now calculates the CRC and compares it with the CRC value received from the DS1957.
If the CRC values do not match, the data transfer was not successful and the Write Status command
sequence needs to be repeated. If the CRC values match, the bus master has to transmit the release
sequence 517FH to signal the microcomputer inside the DS1957 the arrival of new data. As a
confirmation, the bus master will receive all 0s if the release sequence was accepted by the DS1957. If
the bus master receives 1s instead, the release sequence was not accepted and the command sequence
needs to be repeated.
1-WIRE BUS SYSTEM
The 1-Wire bus is a system which has a single bus master and one or more slaves. In all instances, the
DS1957 is a slave device. The bus master is typically a microcontroller or an IBM-compatible PC. The
discussion of this bus system is broken down into three topics: hardware configuration, transaction
sequence, and 1-Wire signaling (signal type and timing). A 1-Wire protocol defines bus transactions in
terms of the bus state during specified time slots that are initiated on the falling edge of sync pulses from
the bus master. For a more detailed protocol description, refer to Chapter 4 of the “Book of DS19xx
iButton Standards.”
HARDWARE CONFIGURATION
The 1-Wire bus has only a single line by definition; 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 have an
open drain connection or 3-state outputs. The DS1957 is an open drain part. The bus master requires a
pull-up resistor at the master end of the bus. Both, the bus master equivalent circuit and the equivalent
circuit of the DS1957’s 1-Wire interface are shown in Figure 5. The value of the pull-up resistor should
be approximately 1.5 kΩ for short line lengths.
A multidrop bus consists of a 1-Wire bus with multiple slaves attached. At regular speed the 1-Wire bus
has a maximum data rate of 16.3 kbits per second. The speed can be boosted to 142 kbits per second by
activating the Overdrive mode. The idle state for the 1-Wire bus is high. If, for any reason, a transaction
needs to be suspended, the bus MUST be left in the idle state if the transaction is to resume. If this does
not occur and the bus is left low for more than 16 µs (overdrive speed) or more than 120 µs (regular
speed), one or more of the devices on the bus may be reset.
X
X
X
X
STAT3
6
5
4
3
2
1
0
STAT2 STAT1
STAT0
7