ESP32 Bit Pirate home
  • 1-Wire
  • Intermediate
  • 5 min
  • Serial CLI

Recipe · Intermediate · 1-Wire

How to write a 1-Wire scratchpad test pattern

Use the documented 1-Wire write sp command to send an eight-byte scratchpad pattern to a supported lab device.

1-Wire EEPROM chip with data line.
A practical ESP32 Bit Pirate recipe based on documented firmware commands.
Step 1

Commands

Run this sequence from the CLI. Adjust pins, addresses or filenames to match your own setup.

Result

What it means

A successful readback proves that reset, command write and scratchpad access all work on the selected bus.

Troubleshooting

  • Re-enter the selected mode setup if pins changed.
  • Confirm the target shares ground with the ESP32 Bit Pirate.
  • Start with short commands before using longer capture or bridge sessions.

Next steps

  • Try the EEPROM shell for supported DS24/DS28 EEPROMs.
  • Use bytecode for lower-level 1-Wire experiments.
  • Document the exact chip family code discovered by scan.

1-Wire scratchpad write FAQ

Why does write sp expect exactly eight bytes?

The documented 1-Wire scratchpad helper is built around an eight-byte pattern. Providing the full byte sequence keeps the command explicit and makes readback comparison simple.

Is this the same as programming an EEPROM dump?

No. A scratchpad write is a small device-specific test path, not a full EEPROM backup or restore workflow. Use the 1-Wire EEPROM shell for supported EEPROM memory operations.

What should I do after writing the pattern?

Read the device back immediately and compare the bytes. If readback changes or fails, revisit pull-up strength, wiring, device support and whether more than one 1-Wire device is connected.

Go deeper