The 1-Wire protocol uses conventional CMOS/TTL logic levels (maximum 0.8V for logic “zero” and a minimum 2.2V for logic “one”) with operation specified over a supply voltage range of 2.8V to 6V.
A Typical 1-Wire Communication Flow
The first part of any communication involves the bus master issuing a reset, which synchronizes the entire bus. A slave device is then selected for subsequent communications. This can be done by selecting all slaves, selecting a specific slave (using the registration number of the device), or by discovering the next slave on the bus using a binary search algorithm. These commands are referred to collectively as network function or read-only-memory (ROM) commands. Once a specific device has been selected, all other devices drop out and ignore subsequent communications until the next reset is issued.
Once a device is isolated for bus communication, the master can issue device-specific commands to it, send data to it, or read data from it. Because each device type performs different functions and serves a different purpose, each type has a unique protocol once it has been selected. Even though each device type may have different protocols and features, they all have the same selection process and follow the command flow seen in the figure below.
Browse these links for more information on the 1-Wire Protocol.
- Overview of 1-Wire Technology and its use (Maxim)
- 1-Wire (Wikipedia)
- 1-Wire Communication with PIC Microcontroller
Example: DS1820 Digital Temperature Sensor
I am going to show you how to connect a DS1820, a 1-Wire digital temperature sensor, to a PIC microcontroller.
We are now going to implement this circuit in our PIC16F628A development board. We will place a 3-pin female header to hold DS1820 and an additional single pin header for a jumper to connect the data pin to a PIC port. Here is the modified board after soldering the female header connections and a 4.7K resistor on the board.
A more closer look:
We will discuss about the 1-Wire built in library of mikroC for PIC 2009 compiler in the next article. Our next experiment is going to be about reading the temperature values from a DS1820 sensor using the 1-Wire communication protocol. Till then, good bye.