Arduino Forum

Development => Other Software Development => Topic started by: kowalski on Oct 17, 2017, 10:53 am

Title: Arduino-OWI: 1-Wire Master/Slave Library
Post by: kowalski on Oct 17, 2017, 10:53 am
This library implements the 1-Wire protocol with the standard rom commands (e.g. alarm, search, match). Both hardware and software bus managers (master mode) are supported. The hardware bus manager uses the DS2482, and the software bus manager Arduino-GPIO. Both can be used with device drivers (i.e. device drivers do not need to be changed). An example device driver for DS18B20 is available.

The library also support slave mode. This allows a simple communication protocol between boards (e.g ATtiny) or emulating a 1-Wire device. Please see the example sketches.

Please see github (https://github.com/mikaelpatel/Arduino-OWI) for source, examples and on-line (https://mikaelpatel.github.io/Arduino-OWI/) documentation.

Cheers!
Title: Re: Arduino-OWI: 1-Wire Master/Slave Library
Post by: kowalski on Oct 25, 2017, 12:42 am
The latest update of the Arduino-OWI (One-Wire Interface) library contains additional support for slave devices. The examples includes an emulation of the DS18B20 and a Remote Arduino with the core functions (e.g. pinMode, digitalRead, digitalWrite, analogRead, somewhat like Firmata but using 1-Wire).

1. Slave OWI Class (https://github.com/mikaelpatel/Arduino-OWI/blob/master/src/Slave/OWI.h)
2. DS18B20 Slave sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Slave/DS18B20/DS18B20.ino)
3. OWI Remote Arduino Driver Class (https://github.com/mikaelpatel/Arduino-OWI/blob/master/src/Driver/Arduino.h)
4. OWI Remote Arduino Master sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Arduino/Arduino.ino)
5. OWI Remote Arduino Slave sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Slave/Arduino/Arduino.ino)

Cheers!
Title: Re: Arduino-OWI: 1-Wire Master/Slave Library
Post by: -dev on Oct 27, 2017, 03:56 pm
A thing of beauty!

One problem I've seen in the past has been an extremely short pulse from the master during SEARCH_ROM. If the Arduino slave misses it, emulation doesnt work.  How short a pulse can the GPIO spin (https://github.com/mikaelpatel/Arduino-OWI/blob/master/src/Slave/OWI.h#L229) reliably detect?

Seriously, another nice clean design and implementation.
Title: Re: Arduino-OWI: 1-Wire Master/Slave Library
Post by: kowalski on Oct 28, 2017, 01:53 am
Quote
How short a pulse can the GPIO spin reliably detect?
The new GPIO library allows pulse detection below 1us as the pin read is actually a single instruction (62.5 ns @ 16 MHz). The major trick in the OWI slave class is actually leaving enough time after each 1-wire bit read/write to allow processing possible interrupts. Blocking for a full transaction with reset pulse and for instance SEARCH_ROM would miss several timer interrupts (for millis).

My "test rig" includes one DS18B20 module, three DS18B20 on a breadboard and an Arduino Leonardo running as an emulated DS18B20 with 25 m telephone grade cable connect. I also use this setup for the remote Arduino test. A Saleae Logic Analyzer is used to monitor the 1-wire bus.

Please put the library to the test. I welcome your feedback and improvement suggestions. BW I will be adding a 1-wire based LCD module to further demonstrate how the 1-wire slave can be used.

Cheers!
Title: Re: Arduino-OWI: 1-Wire Master/Slave Library
Post by: Arcana009 on Apr 08, 2019, 10:45 pm
The latest update of the Arduino-OWI (One-Wire Interface) library contains additional support for slave devices. The examples includes an emulation of the DS18B20 and a Remote Arduino with the core functions (e.g. pinMode, digitalRead, digitalWrite, analogRead, somewhat like Firmata but using 1-Wire).

1. Slave OWI Class (https://github.com/mikaelpatel/Arduino-OWI/blob/master/src/Slave/OWI.h)
2. DS18B20 Slave sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Slave/DS18B20/DS18B20.ino)
3. OWI Remote Arduino Driver Class (https://github.com/mikaelpatel/Arduino-OWI/blob/master/src/Driver/Arduino.h)
4. OWI Remote Arduino Master sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Arduino/Arduino.ino)
5. OWI Remote Arduino Slave sketch (https://github.com/mikaelpatel/Arduino-OWI/blob/master/examples/Slave/Arduino/Arduino.ino)

Cheers!

Hello,

 I want to ask if there is any documentation on how to use those libraries (commands explanation , errors meaning, timing specification and so on.

I figured where is the documentation.

Thank you