Friday, February 5, 2010

The 1-wire bus

The 1-wire bus is a protocol from DALLAS semiconductor to implement a master-slave network of small devices. The network is controlled by a master (in this case the microcontroller) and n slaves which have an unique identifier of 64bits, the slave has the unique code buried within it. Only 3 cables are necessary to communicate with each node, ground, +5v and one data wire, although it is also possible to use the data cable as power source using an special work mode called "parasite mode".
  • The master starts a transmission with a "reset" pulse, which pulls the wire to 0 volts for 480 µs.
  • To send a "1", the bus master software sends a very brief (1 - 15 µs) low pulse.
  • To send a "0", the software sends a 60 µs low pulse.
  • When receiving data, the master sends a 1-15 µs 0 volt pulse to start each bit. If the slave wants to send a "1", it does nothing, if the slave wants to send a "0", it pulls the data line to ground for 60 µs.
The basic sequence is a reset pulse followed by an 8-bit command, and then data is sent or received in groups of 8-bits. There are several standard broadcast commands, and commands addressed to particular devices. The master can send a selection command, and then the address of a particular device, and then the next command is executed only by the selected device.

PCB implementing a 1-wire bus for testing purpouses

See 1-Wire devices
See One-wire library from Jim Studt, Tom Pollard & Paul Stoffregen

No comments:

Post a Comment