Xwire: Hardware requirements & wiring
Xwire port
In its basic form Xwire is intended for use with a simple twisted pair connection to the Xwire port provided on certain SPLat products. The Xwire port can appear in different forms:
- On the CC18 and HD8 controllers it comprises two 2-pin connectors labelled X1 and X2. The two are connected in parallel on the board. The duplication is simply to simplify wiring up several CC18s.
- On the MS120 controller there is a single 2-pin connector labelled X1.
- On Xwire peripheral boards one or two 2-pin connector(s) labelled X1 and X2. These generally also have an onboard RS485 interface that can be jumper selected.
- The SL100 was designed before we thought up Xwire. However, the signals can be brought out of the SPice connector using a special wiring arrangement.
- Early MMi202 had Xwire on the SPice connector, like the SL100.
- The MMi202A has dedicated Xwire connectors.
The Xwire port has 2 pins. One is ground. The other is a bidirectional data line and can be in transmit mode or receive mode.
Xwire wiring
All Xwire ports in a system are simply wired in parallel, like pin to like pin. On boards with two connectors (say CC18), connectors X1 and X2 are interchangeable and can be used for daisychaining. The interconnecting cables can be made with the two wires lightly twisted together, say one twist every 25mm. You can also use screened single core cable, which is better for noise immunity but takes more effort to make.
The above diagram shows the suggested wiring arrangement for 2 or more controllers connected by Xwire. The Xwire connectors are interconnected with twisted pair cables. For the boards illustrated there are X1 and X2 connectors. These are interchangeable and connected together on the boards.. In effect the 3 boards have their Xwire ports wired in parallel. Notice that we have shown the power supplies for the boards wired individually back to the power supply. This is called a star arrangement and is less likely to have noise problems that a bussed (parallel) power distribution scheme. What you absolutely must not do is get lazy and let the Xwire ground circuit carry power supply return (ground) currents. Keep the power supply ground wires as heavy and as short as you can.
If you are wiring together several boards that have only one Xwire connector, say MS120s, you will have to make Y cables (2 wires in each pin).
In the diagram above we have shown how you would go about using Xwire in a vehicle. This would typically be one SPLat in the cabin (the lefthand one) and one "down the back of the truck". Only the latter is switching heavy loads. The SPLat in the cabin would typically be an MS120 used as an operator interface. It would be the master controller and not switch any heavy loads.
There are two other important aspects of this scheme:
- There is only one ground connection.
- The Xwire signal is run through shielded cable (and definitely not wrapped around the ignition coil or alternator!)
This is not a recommendation to use standard SPLat products in an automotive environment. You should consider it a technique to use for Proof of Concept work. We do make custom SPLat controllers for automotive use, and they have a significant amount of additional built in protective circuitry.
Wire dress
The Xwire wiring should be kept well away from any wires or objects that can generate electrical noise or "spikes". This includes such things as
- Relays and contactors (anything that makes sparks, inside or outside)
- Electric motors
- Variable Frequency Drives (VFD, VSD)
- Radio transmitters
- Triac and SCR circuits.
- Power wiring to/from any of the above.
In general it is a good idea to keep the Xwire wiring close to the DC power supply wiring, so large loops are not formed that can pick up noisy magnetic fields.
When testing wiring arrangement you can use the XwireGetErrCount
instruction to good effect. If your controller has a display, put the count on the screen. Otherwise store it in RAM and use SPLatLink (the SL button on the SPLat/PC module window) to read it out.