0
\$\begingroup\$

I want to route two different CAN BUS signals (differential) to a CAN controller. Since the controller has only one CAN interface, I can not connect both differential CAN signals to the input of the controller at the same time. I was thinking about using a physical dip switch and then route the signals to the controller by opening on CAN signal line and closing the other signal line and vice versa.

Since CAN implements differential signaling scheme, is it possible to use DIP switches? Does the signal get distorted? Or is there any alternative where I could control the switches with a micro-controller instead?

\$\endgroup\$
  • 2
    \$\begingroup\$ Are you sure you can't have them connected to the controller simultaneously? CAN is a multi-drop bus and it's common to have many devices on it. \$\endgroup\$ – pericynthion Sep 27 at 8:13
  • 1
    \$\begingroup\$ You are right in saying that can is a multi-drop BUS. I am talking about two signals or two different protocols coming from the diagnostic port of a car. Lets say that one is CAN classic and other is J1939(same physical layer as CAN) protocols, one transceiver can be used to get both types of the above mentioned signals but only once at a time, not simultaneously \$\endgroup\$ – adnan Sep 27 at 8:45
  • 3
    \$\begingroup\$ A DIP switch is about 1cm, or about 50 picoseconds in electrical size. With 100 nanosecond rise/fall time for CAN bus edges, the DIP will be fine. \$\endgroup\$ – analogsystemsrf Sep 27 at 11:21
  • \$\begingroup\$ "two different CAN BUS signals" What's the meaning of this? 2 signals or 2 buses? One CAN bus consists of at least 3 signals: CANH, CANL and GND. It sounds as if you are trying to connect the CAN bus directly to the controller without a transceiver or something silly like that? \$\endgroup\$ – Lundin Sep 27 at 13:12
  • 1
    \$\begingroup\$ "Lets say that one is CAN classic and other is J1939(same physical layer as CAN)" CAN is the physical layer of J1939. This is just getting more and more confusing. \$\endgroup\$ – Lundin Sep 27 at 13:17
1
\$\begingroup\$

Sure you can switch the signals (double pole and double throw DIP switches are also out there).

The traffic may get garbled up if you have A from one bus and B from the other bus connected during switch over. A DIP switch is not much different than a connector as far as the electrons are concerned.

https://www.google.com/search?q=DPDT+DIP+switch&tbm=isch

\$\endgroup\$
0
\$\begingroup\$

No. You will interfere with during switchover, or even short them together temporarily. I've used a relay to extend a CAN bus and this already causes a few lost messages.

It's easier to run the 3.3V level signals trough a mux or switch. This way you will not intefere with any of the busses upon switchover or when switched off.

Please make sure the transceivers go into recessive state when disconnected.

\$\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.