Line Drivers for SPI

I am trying to set up a Line Driver/Receiver to run an SPI connection 30 feet to a distant box of LEDs and switches.

I am thinking of using a 26LS31 / 26LS32 pair. I would like to use it to transmit SPI using a CAT5 cable. I read the datasheet of the Driver and Receiver, and it seems that in order to use the Driver/Receiver, I need to have a differential pair for each line (A and B from 26LS31 going into X and Y of the 26LS32). For SPI, I need to transmit MISO, MOSI, CLK, and SS, and so that will take up all 8 wires in the CAT5 cable.

I believe I also need 5V and 0V for the SPI to be able to work on the distant end. Does that mean that I effectively need 2 CAT5 cables to do this, or is there another way?

Thanks in advance!

Right, you need 2 more wires for powering the remote device. Unless you spend another power supply for the remote station.

Feddar:
I am trying to set up a Line Driver/Receiver to run an SPI connection 30 feet to a distant box of LEDs and switches.

I am thinking of using a 26LS31 / 26LS32 pair. I would like to use it to transmit SPI using a CAT5 cable. I read the datasheet of the Driver and Receiver, and it seems that in order to use the Driver/Receiver, I need to have a differential pair for each line (A and B from 26LS31 going into X and Y of the 26LS32). For SPI, I need to transmit MISO, MOSI, CLK, and SS, and so that will take up all 8 wires in the CAT5 cable.

I believe I also need 5V and 0V for the SPI to be able to work on the distant end. Does that mean that I effectively need 2 CAT5 cables to do this, or is there another way?

Thanks in advance!

SPI is meant for ON Board communications Total wiring < 30cm. How slow are you going to clock it?

Those drivers/receivers were designed for RS422. You are going to have to slow down your SPI below 1mhz, and watch your capacitance and definitely install termination loads. Do you have a oscilloscope to look at the signals? I would not be surprised if you see some pretty dirty waveforms.

Chuck.

You could use the LTC6820 instead -> Mixed-signal and digital signal processing ICs | Analog Devices

Although you don't need the isolation it provides, it does convert SPI into a high frequency differential signal that can be transmitted 100 meters on one pair in a CAT5e cable.

That'd leave you enough pairs for your +5V and gnd. It looks seamless from the Arduino's POV:

ltc6820.png

DrDiettrich:
Right, you need 2 more wires for powering the remote device. Unless you spend another power supply for the remote station.

I could have a separate power supply on the distant end, but don't the grounds have to connect?

chucktodd:
...Those drivers/receivers were designed for RS422. You are going to have to slow down your SPI below 1mhz, and watch your capacitance and definitely install termination loads. Do you have a oscilloscope to look at the signals? I would not be surprised if you see some pretty dirty waveforms.

Speed is not an issue for me in this project. The purpose of the project is to use a bunch of switches and lamps/LEDs to send 'signals' between two rooms. I plan on later adding some LCD numbers or an array of LEDs. I suppose speed may be more important at that time.

By terminal loads, do you mean 100 Ohm resistors between A and B of the respective Driver and Receiver? But what do you mean by 'watching your capacitance'?

I don't have an oscilloscope. I wish I did...

BigBobby:
You could use the LTC6820 ... Although you don't need the isolation it provides, it does convert SPI into a high frequency differential signal that can be transmitted 100 meters on one pair in a CAT5e cable.

The problem I foresee is that I can only find the LTC6820 (on DigiKey) in surface mounted format. I generally use through-hole format and sockets, in order to avoid frying the IC white my under par soldering technique.

Also, in the diagram you included, it looks like you need an induction coil on each side of the transmission line (attached to IP and IM). I'm trying to make my way through the data sheet, but I find them so confusing.

Again, thank for your help.

Here is my schematic so far. As you can see, I did not include both differential pairs for each line.

SPI depends on the clock signal being synchronized with the data. If you have a long line (like 30m) then by the time the signal reaches the slave and it puts a bit on the MISO line and then that arrives back at the master, the master has moved on to the next bit.

There is a clever method to get around this or you can go really slow but there are other problems with long wires. They can pick up damaging voltages by induction. That is why the LTC6820 shows transformers at both ends of its transmission line.

Proper RS232 is excellent at this kind of distance. A couple of MAX232 chips and any handy piece of cable and you're done.

Feddar:
The problem I foresee is that I can only find the LTC6820 (on DigiKey) in surface mounted format. I generally use through-hole format and sockets, in order to avoid frying the IC white my under par soldering technique.

Also, in the diagram you included, it looks like you need an induction coil on each side of the transmission line (attached to IP and IM). I'm trying to make my way through the data sheet, but I find them so confusing.

As the previous poster mentioned, those are small signal transformers (not inductors) and they are required by the LTC6820. One of the reasons is for EMI immunity, but they are primarily for isolation. For example if you did decide to put a power supply at your remote electronics, then you wouldn't need to bring ground over on the cable: you could achieve all of your SPI communication with one single differential pair. The Parts List on page 18 of this link shows 4 alternatives for this transformer -> http://cds.linear.com/docs/en/demo-board-manual/dc1941cfa.pdf

They are, however, all surface mount transformers. You could probably find throughhole equivalents, but there is no throughhole version of the IC itself. Unfortunately if you want to use the newest ICs, you'll find many of them only come in surface mount packages now.

You might want to use this as an opportunity to lose your fear of surface mount soldering, however. I think you'll find with a flux pen (they are magic!!!) that soldering surface mount chips is easier than you thought (well, the MSOP package anyway...not the QFN). If you're building your circuit on a perf board or something, you can always get adapters like these -> PA-SOD3SM18-16 Logical Systems Inc. | Prototyping, Fabrication Products | DigiKey

Thanks for the encouragement. I may just do that.

On page 20 of the datasheet, Mixed-signal and digital signal processing ICs | Analog Devices, there is another list of transformers. Only 1 is on both lists, the Pulse PE-68386NL. It has no centre tap and no choke. Are these important?

A through hole alternative on the datasheet that found has a turns ration of 2:1. Is this acceptable?

Thanks again.

Feddar:
Thanks for the encouragement. I may just do that.

On page 20 of the datasheet, http://cds.linear.com/docs/en/datasheet/6820fa.pdf, there is another list of transformers. Only 1 is on both lists, the Pulse PE-68386NL. It has no centre tap and no choke. Are these important?

A through hole alternative on the datasheet that found has a turns ration of 2:1. Is this acceptable?

Thanks again.

All of the parts on the datasheet are acceptable. The centre tap and choke are important in extremely noisy environments, but in your application they should not be necessary.

Heh...honestly, the part is sort of overkill for what you are doing. It was mainly developed for automotive and industrial environments to be a low cost way to provide isolated communication and high EMI immunity with a minimum number of wires. On the Porsche Mission E they needed the centre tap and choke. In your application, unless you have gigantic motors in each room that you haven't mentioned, you should be fine with the most basic implementation.

Are you saying I may be able to do it without even using a transformer at all?

Feddar:
Are you saying I may be able to do it without even using a transformer at all?

You probably could, although I don't know of anyone using it that way. I usually don't like to stray far from the diagrams in the datasheet, but this datasheet does assume most people want the isolation and EMI immunity...not just the reduction in wires.

Figure 17 shows the ICs being used with only one transformer. Figure 18 shows the ICs being used with capacitors instead of transformers. They don't have any figures showing the ICs directly connected, however, and I don't know of anyone using it that way.

Great! I missed that. I'll give it a look.

Thank you so much for your help. I wish I had known this 2 weeks ago. Would have saved me a lot of trouble.

For prototyping, you may also find PCBs like this to be useful... of course, I'm hardly an unbiased party, since I sell them - I also sell breakout boards for common SMD packages.

I would likewise say that there's no time like the present to lose your fear of SMD soldering. These are the key things:

Leaded solder - lead free makes everything harder, so definitely start with leaded solder. Obviously, don't eat the solder.

Temperature controlled soldering iron. 700 degrees is fine, at higher temperatures, the chance of lifting a pad increases dramatically. I'm convinced that at least 50% of the time people say their soldering technique is poor, a too-hot iron is (part of) the problem.

Good lighting

Tube of flux - I use generic "no clean gel flux".

The general technique is to put a bit of solder on a pad in the corner, solder the chip in place on that one pad, then put the flux down along all the pins, and then get a little solder on the iron and touch it to the pins to be soldered (with a bit of practice, you can drag it over the pins). If you bridge contacts, you used a bit too much solder. Sometimes dragging away from the chip with the iron will break the bridge, or you may have to use a bit of desoldering braid or a solder sucker to get rid of excess solder. Look up drag soldering on youtube et al for videos. This technique makes a huge difference - the first time I tried it, it was much better than I'd ever done trying to do it without flux. With only a little practice, I found SOIC faster to solder than DIP.

I got 2 LTC6820 from Digikey, and boy these chips are small!

The problem is that I cannot find any MSOP16 breakout boards. Do they exist? If not, how can I use this chip.

Thanks again!

Feddar:
I got 2 LTC6820 from Digikey, and boy these chips are small!
The problem is that I cannot find any MSOP16 breakout boards. Do they exist? If not, how can I use this chip.
Thanks again!

They do exist:-
MSOP-16 to DIP-20 SMT Adapter

OldSteve:
They do exist:-
MSOP-16 to DIP-20 SMT Adapter

TY OldSteve.

To the OP: I'm on my phone right now so I can't check, but did the digikey adapter I linked to before not fit? If not I feel dumb as I thought I'd checked the dimensions.

BigBobby:
TY OldSteve.
To the OP: I'm on my phone right now so I can't check, but did the digikey adapter I linked to before not fit?

Bobby, I'm far from an expert on SMD devices, (I only ever use through-hole), however MSOP16 are 0.5mm pitch I think, but isn't the adaptor you linked 1.27mm pitch, for SOIC?

Nope, it's .5mm pitch
http://www.proto-advantage.com/store/advanced_search_result.php?keywords=ipc0079&x=6&y=6

CrossRoads:
Nope, it's .5mm pitch
Proto Advantage

That's the one that I linked, not the one that Bobby linked to in reply #6, (this one):- PA-SOD3SM18-16 Logical Systems Inc. | Prototyping, Fabrication Products | DigiKey

OldSteve:
Bobby, I'm far from an expert on SMD devices, (I only ever use through-hole), however MSOP16 are 0.5mm pitch I think, but isn't the adaptor you linked 1.27mm pitch, for SOIC?

Yes, I messed up on the inches to mm. When I looked at the drawing I saw the 0.05" and thought 0.5mm. 0.05" is 1.27mm, however.

Hopefully the OP didn't order that adapter already and thanks for linking to the correct one.