0
\$\begingroup\$

let`s say I have 2 Microcontrollers and I want to connect them to send data between them. I have one dataline and GND (datarate or how to sync is not part of this question). Is there a possibility that I create a circuit where it doesnt matter which way I connect the the 2 Lines so that one MCU detects which Rail is GND and on which rail to send the data?

Both of them have to be connected to the same gnd right?

I have seen some Bussystems where it doesn`t matter how the 2 Lines are connected. How is this archieved?

Thanks in Advance

EDIT

would it be a good idea to implement some kind of twisted pair communication?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Is there a possibility that I create a circuit where it doesnt matter which way I connect the the 2 Lines so that one MCU detects which Rail is GND and on which rail to send the data?

If you want good data integrity with a single-ended (unbalanced data signal) then you make sure the ground referenced wire is connected to ground at both ends. Having said that, if you want to treat the two (supposedly unmarked or otherwise indistinguishable) wires as swappable and use some electronic circuit to un-muddle the signal and feed the receive MCU the correct polarity then that works but then you get a problem with data sent back in the other direction, like, how the un-muddling circuit will know which way data is being sent so that it doesn't try to do stuff when it shouldn't be doing stuff.

If you are somewhat concerned with data integrity then use a pice of coax and wire it up correctly. Alternatively you can send the signal differentially and use differential manchester encoding because decoding it doesn't depend on which line is which.

would it be a good idea to implement some kind of twisted pair communication?

Shielded/screened twisted pair is probably the best in terms of reducing bit errors and, of course, lends itself to differential manchester encoding/decoding

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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