A while a go I stumbled across Maxim’s AN214 Tutorial 214 which explains in an abstract level how to implement a 1-wire master bus interface using a microcontroller UART peripheral. This is ideal for me because quite often I use the DS18S20 to quickly add a calibrated temperature sensor onto my clients projects. Unfortunately, the projects that I tend to work on are either low power or the microcontroller is having to drive varies time critical task. Either way, bit banging the 1-wire interface always ended been an issue. Assuming that you have a spare UART on your micro, this is a good way to avoid bit banging the interface.
The Maxim’s tutorial does do a good job at explaining how the 1-wire works and it does give enough information for someone with experience to write their firmware. That said, I’ve writing portable a portable library using Maxims which should help anyone wanting to see a code example of this project or at the very least safe you sometime from having to write the logic.
I writting a portable library takes advance of the
one as well as the and how to UART implementation works so I’m not going to bother to go into the details of 1-wire. Inst
Considering that the alternative would be bit bang your own (which isn’t too bad) or Using I’ve implemented a set of libraries for communicating with devices through a 1-wire interface. The libraries are portable and should be easy to implement on your target device.
git clone https://github.com/Opticalworm/EmbeddedLibrary.git
Depending on the microcontroller, you can potentially reduce component count. For example, if the microntroller has an open-collector that you can enable on the UART TX line, then you only need a pull-up resistor and you good to go.
Leave a Reply