See the latest version in the documentation wiki.
Reliq sent a 1-Wire iButton demo using the Bus Pirate:
I work in an engineering firm, and the large format color printer we have uses iButtons on the ink tanks to tell the machine what has been plugged in. These particular buttons are write-only. As you can see in the pic, I have the body connected to GND, and the cap connected to MOSI. The +5v is jumpered to the Vpullup pin.
More demo goodness after the break.
|MOSI||1-Wire data (cap)|
The table above shows the connections between the Bus Pirate and the iButton. The Bus Pirate’s 5volt supply powers the on-board pull-up resistors through the Vpullup pin. The iButton is powered by the pull-up resistors on the 1-Wire data line, it doesn’t need a separate supply.
HiZ>m <<<select mode
(1) >2 <<<1-wire
1WIRE routines Copyright (C) 2000 Michael Pearce
Released under GNU General Public License
1-WIRE>p <<<enable pull-up resistors
1. Pull-ups off
2. Pull-ups on
Pull-up resistors ON
1-WIRE>W <<<power supplies on
POWER SUPPLIES ON
1-WIRE>v <<<check voltage levels
Voltage monitors: 5V: 4.8 | 3.3V: 3.3 | VPULLUP: 4.8 |
First, put the Bus Pirate in 1-Wire mode (m). Enable the pull-up resistors (p) and turn on the power supplies (W). Press ‘v’ to check the voltage levels. If the Vpullup voltage is 0, make sure the Vpu pin is connected to a power supply (5volts in this demonstration).
1-WIRE>(240) <<<1-Wire search ROM command
Macro 1WIRE address
1.0×89 0xCE 0x42 0x03 0x00 0xA0 0x00 0xDB
Device IDs are available by MACRO, see (0).
1-Wire device addresses are located using a special 1-Wire search ROM procedure. The Bus Pirate automates this in with macro (240). Every device address located is printed to the terminal.
The first byte of the address (0x89) is the device family code, the Bus Pirate didn’t know this particular code. According to this 1-Wire device command table, 0x89 corresponds with a 48 bit node address chip. That seems appropriate given the use.
The remaining bytes are a unique ID code that’s used for various purposes, these were used to identify ink tanks. It would be fairly difficult (expensive) to create an actual 1-Wire device clone with an identical ID number, but it would be really easy to extract the number from a chip and emulate the device on a microcontroller.