Using 1-Wire
The Binho Nova Multi-Protocol USB Host Adapter can function as a Dallas 1-WIRE host device. This protocol can be configured to operate on any of the IO pins on the device, however it is especially convenient to use it on IO0 and IO2 as the internal pull-up resistor can be used thus eliminating the need for an external pull-up resistor.
The following table gives a brief overview of the available 1WIRE commands.
Command
Description
Link
Feel free to jump ahead to the ASCII Command Set reference to learn the specifics of each command, or continue below to see an example of how to use these commands to achieve communication on the 1-WIRE bus.
1-WIRE CommandsSetting Up the 1-WIRE Bus
The first step in using the Binho Nova Multi-Protocol USB Host Adapter as a 1-Wire host is to put the adapter into 1-WIRE mode using the Device Operating Mode command.
Now the host adapter is in 1-WIRE communication mode. The 1-Wire bus has no configurable settings, so all we need to do is decide which IO pin we want to use. Let's take advantage of the internal pull-up resistor on IO0:
And just like that, we're ready to start communicating with 1-Wire devices on the bus.
Selecting a Target Device
Let's get things started off right by first resetting all the devices on the bus:
With all the devices reset, it's now possible to begin the process of selecting the device that will be communicated with. Let's start a search for devices on the bus -- but before doing the search, let's make sure we start at the beginning of searching through the devices by reseting the search.
Alright, now let's begin the search:
Let's see what the search found. We'll query the address to see what device was found:
That's great - the exact device we were looking for! Now that we know the address of desired device is in the ADDR
field, we can move ahead with sending and receiving data.
Sending and Receiving Data
Now let's get the device's attention and ready to interact with us. This is done by sending another RESET
command:
Now let's select the device we'll be communicating with -- recall that it's address is already in memory from the result of our SEARCH
command.
Finally let's do some reading and writing:
That's all there is to it! Of course getting the transaction complete before any timeouts occur can be challenging when manually interacting with the devices on the bus using these commands, however this isn't an issue when scripting the interactions. When it comes to manually interacting with 1-Wire devices, we highly recommend using the WHR command. You can see how to do this in our video tutorial embedded below:
Check out the examples section to see how to use 1-Wire in an automated way:
Examples1-Wire is just one of the common protocols which utilizes just one signal for bi-directional communication. On the next page we'll look at Atmel's Single-Wire Interface which is another similar protocol.
Last updated