One-wire Device Tree Builder

The Beaglebone black has a complex naming scheme for assigning GPIO hardware, using several different names for each. There seems to be some confusion about how to create a Beaglebone device tree overlay for the one wire interface. I put together a quick tool to generate a .dts file that is customized for your chosen GPIO pin and will be ready for compiling. Note this tool currently only handles a single GPIO pin. This should be fine for using the Dallas one wire interface as you can connect multiple sensors to the same GPIO input. For details on how to compile and use with a DS18B20 temperature sensor, see this post.

1. Choosing a GPIO Pin



Refer to the table to the right for pin reference if you are not sure. Pins are numbered according to the header block and then consecutively. Let’s use the image as reference. Say I am using the right header (P8) and the fifth pin down on the second column (08). This translates to P8.10
Notice that the number of the pin does not correspond to the GPIO number! Also of importance, you cannot simply choose any pin. Some of the pins are reserved- for example, most of the higher numbered pins on the P9 header are taken up by the HDMI interface unless you have disabled it.

If you need to determine which GPIO pins are free, there’s a handy NodeJS script here: https://github.com/MarkAYoder/BeagleBoard-exercises/blob/master/gpio/freeGPIO.js.

2. Generate Device Tree

Select your GPIO below, then select display to show your code in-browser or download to save as a .dts file.

 

Now you are ready to use the generated code to build your device tree overlay. This is outlined in another post.



Leave a Reply

Your email address will not be published. Fields with * are mandatory.