0
\$\begingroup\$

I want to setup two-way digital communication between 2 Arduinos, but I'm only allowed one wire between them. One may be "master". Are there any well known methods for synchronizing communications, etc.? I don't want to reinvent the wheel.

I've been teasing the idea of analog signaling allowing for multiple channels on the same wire, but that seems to involve some more complicated electronics.

\$\endgroup\$
  • \$\begingroup\$ So have you googled at all? There is "One-wire bus" as a start... \$\endgroup\$ – John U Sep 27 '13 at 8:14
  • 1
    \$\begingroup\$ Do you mean one wire plus a common 0V/ground connection or are you saying "nothing but one wire". Zero wires work - it's called radio. \$\endgroup\$ – Andy aka Sep 27 '13 at 11:13
  • \$\begingroup\$ one wire with a common ground. \$\endgroup\$ – Chet Sep 27 '13 at 20:00
1
\$\begingroup\$

The ATtiny4/5/9/10 uses a single pin for both data input and output during programming. It drives the output only for the first 1 bit in a run of 1s; for the rest of them it switches the pin to an input with a pullup (thereby holding the line high), and then checks the input for a 0 in order to attempt to detect collisions.

Combining this with a normal bit-banged UART should allow you to create a one-wire channel between devices.

But don't forget that both devices need a common ground regardless.

\$\endgroup\$
  • \$\begingroup\$ hmm. can you elaborate on this protocol a little bit? how do you ensure synchrony? \$\endgroup\$ – Chet Sep 27 '13 at 20:08
  • \$\begingroup\$ See, that's the thing. UARTs don't ensure synchrony, nor do they require it; they recover the clock from the bitstream. If you need to keep the two devices in sync then you'll have to do it at a higher level, e.g. waiting until a specific message has been received. \$\endgroup\$ – Ignacio Vazquez-Abrams Sep 27 '13 at 20:23
1
\$\begingroup\$

SoftwareSerialWithHalfDuplex library has an example of connecting up to 10 Arduinos to a single line and having each one listen to the master for it's address and then responding within the timing parameters set by the master, but on the same line, while the master is listening and not driving the line. this is generally known as half duplex, because only one side can talk at a time. Full duplex is when the two partis can actually talk simultaneously and their signals both get through.

http://forum.arduino.cc/index.php?topic=114553.0

https://github.com/nickstedman/SoftwareSerialWithHalfDuplex/blob/master/examples/SoftwareSerialWithHalfDuplex_test_partA/SoftwareSerialWithHalfDuplex_test_partA.ino

\$\endgroup\$
1
\$\begingroup\$

There are. Check out 1-wire serial protocol. And there's even an arduino library for it!

\$\endgroup\$
  • \$\begingroup\$ I found this, but I'm trying to stray away from proprietary... \$\endgroup\$ – Chet Sep 27 '13 at 20:02
  • \$\begingroup\$ @Chet - Just because one manufacturer makes parts that use a protocol doesn't make it "proprietary". If the comm protocol is documented well enough that there are 3rd party libraries that implement the entire protocol, it's more or less public. \$\endgroup\$ – Connor Wolf Sep 28 '13 at 0:19
0
\$\begingroup\$

Nordic provide very cheap two way point-to-point radio communications devices and this means you physically have no connecting wires unless you regard the antennas as wires.

As far as I'm aware they have devices that take straight digital in (without worrying about packaging the data in a format suitable for radio) and they give straight digital out.

It might be worth a look.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.