Getting access to 1-Wire devices

In the next section, we will manage a 1-Wire device using both an emulated 1-Wire controller and a real one connected by I2C to the main CPU.

Using the GPIO interface

To show you how the 1-Wire bus works, we can use a really simple chip: the temperature sensor DS18B20. There are two possible ways or modes by which the chip can be powered: a parasite version (that is, the one that works in the parasite mode) with two wires only and a normal version with a dedicated power pin, which uses three wires instead. In our example, we will use the three wires and a waterproof version of this chip. There is a special packaging of the chip so that it can be used in hostile environments (look at the following image to see the ...

Get GNU/Linux Rapid Embedded Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.