Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

Why is DS28E17 status still misaligned after BUSY ends on a 16 MHz controller board?

A logger reaches a remote I²C sensor through a DS28E17 and uses a 16 MHz active oscillator for the local controller. Production firmware changed from reading busy bits repeatedly to waiting for the external BUSY signal and immediately reading status. The sensor receives the write, but the decoded status changes. The first bit can explain the failure. Analog Devices requires the host to consume a zero-valued 1-Wire completion slot before status, regardless of how it decided the I²C transaction had finished.

Each bus has a separate completion indication

The DS28E17 is a peripheral on the 1-Wire side and a controller on the I²C side. The host selects it, then sends the bridge command, target address, count, data and CRC. For Write Data with Stop, opcode 0x4B, a valid request causes the bridge to generate START, write address, data and STOP downstream. The host may wait, monitor BUSY or poll with 1-Wire read slots. It must still read a single zero-valued slot before going on to status.

An older polling loop may have already consumed that zero. A new path that only waits on BUSY has not. Starting the byte-read routine immediately can put the zero in the first status position and misalign the rest of the response. Label the completion slot separately on the analyzer, then group the following bits into bytes. Reversing bit order until the value looks reasonable does not fix the missing slot.

Check both transactions. First verify the command, target and CRC on 1-Wire. Check downstream START, acknowledgment and STOP. Then inspect the returned status for success. An absent I²C target can also let a transaction finish quickly. Compare an installed target with a deliberately unused address on a fixture. Consume the completion slot in both cases and verify that the returned statuses remain distinct.

Calculate timing on each side

If the timer runs directly from the 16 MHz active oscillator, one tick is 62.5 ns. That reference times upstream drive, release and sampling. The bridge produces its own downstream clock. Changing the host timer divider does not change I²C speed from 100 to 400 kHz. Set the bridge's documented speed field, then measure the bus. Check the startup default if the downstream part supports only Standard mode.

A two-byte write includes an address and two data bytes. At nine clocks each including acknowledgment, this is twenty-seven clocks. Without stretching or START and STOP overhead, it takes about 270 µs at 100 kHz or 67.5 µs at 400 kHz. The corresponding 1-Wire request itself includes seven body bytes, including its two CRC bytes. Fifty-six slots at a measured 70 µs each occupy 3.92 ms before reset, selection and readback. The downstream clock's fourfold increase does not make the whole operation four times faster.

The bridge also waits if the target stretches SCL low. The twenty-seven-clock example therefore gives nominal unstretched timing. A fixed wait based only on that estimate can expire early. Capture 1-Wire, BUSY, SCL and SDA for an ordinary write and a controlled stretch. Verify that the host still advances on completion rather than a guessed duration.

Keep two startup traces for the speed configuration as well. Write Configuration 0xD2 takes a speed byte. Its low two bits select the rate, with zero selecting Standard mode. The data sheet lists 400 kHz as the power-up default. Read Configuration 0xE1 can verify the setting. With a fixture that does not stretch SCL, measure the startup clock, select Standard mode and measure again. This catches assumptions that a previous speed persisted through power loss. Use only the downstream target's permitted rate.

Give the diagnostic an explicit timeout result. If a downstream line stays low, polling may never reach completion. Preserve the last observed busy state, downstream clock level and original command, then follow the documented recovery for the bridge and target. Avoid repeating a write until its outcome has been considered. Test first with a harmless register that can be written repeatedly, and define separate retry rules for commands with side effects.

Record the oscillator and actual timer, configured I²C speed, full command, separate zero-valued slot, status and downstream result. For a replacement 16 MHz active oscillator, measure the host's real 1-Wire slots and repeat the same sensor transaction end to end. This verifies the timing and the reply sequence independently.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.