Onewire

A while back, The Artful Engineer was involved with a project requiring the use of a Onewire ADC chip to remotely read several analogue sensors. Nothing unusual there you might think – and you’d be right, normally.

This was a long term project. Midway through the ADC device was made obsolete without replacement. It seems reading analogue signals through a Onewire connected ADC is not a common thing to do. Who’d have thought?

The Engineer came up with a solution. Implement a Onewire slave stack on a microcontroller. Thus began the fateful journey.

You see, this also is not a common thing to do and as it turns out, with good reason. Go Google for yourself. You will find many implementations of a Master stack but very few Slave stacks, and fewer still that are any good.

Why is this? It turns out that a Onewire bus has very tight timing requirements, made worse by Masters that don’t strictly adhere to them. In standard mode operation, the slave must respond to a negative edge on the bus in less than a microsecond.

Even with modern microcontrollers, this is easier said than done and requires some careful design and structure of firmware to achieve, especially if the Onewire bus is only a small part of the application.

Of course the Engineer began without knowing this. Along the way this project, through pure interest, became an obsession.

Read on to find out more!