Extend SPI bus between Arduino Due & FLiR camera

I have got the example code shown below by Josep Bordes working fine using the Arduino Due to interface the Thermal FLiR camera using SPI & I2C bus.

I was wondering if you can help with any ideas to solve a problem I have extending the SPI bus from the Arduino Due to the FLiR camera…

I have built a circuit using DS8921 differential line driver/receiver chips to transmit signals from the Arduino Due SPI 4 data lines to the FLiR 4 data lines and at the moment I use only a very short cable 10cm to test everything by entering the ‘captureImage’ command in the serial monitor.
I have put an oscilloscope on all 4 SPI signals when connected via my line driver circuit and it works for the CS, CLK, MOSI lines (correct waveforms) but I have a problem on the MISO line… (See image attached)

The correct MISO signal has 2 separate pulse combinations but when I connect it through my line drivers circuit the MISO signal has a continuous one pulse train that doesn’t end after I enter the ‘captureImage’ command.

I have tried the following but they don’t fix my problem:

  • I have tested circuit and it works fine and also adjusted the SPI clock in software code to slow down the clock speed i.e. software clock slowed by divide by 32 and 64 in software SPI.setClockDivider(5);
  • I have tested with a 100 ohm resistor connected and disconnected to the receiver differential pair that goes to the FLiR.

If you have any suggestions to try that would be great.

How far do you want to go? Standard SPI will go 10-20 feet easily. I've never tried more but I expect it will work.

The real issue with long wires on SPI is the time taken for the signals to travel down the wire. The MISO signal ends up too late for the master to sample it at the right time. (Don't forget to add four of the delays due to your line drivers.) I've seen suggestions that really long SPI should send the clock for the full round trip so that a second SPI input on the master will be correctly clocked to sample the MISO.

You should always use termination resistors with that kind of line driver.

Video trigger on the scope? That doesn't seem right.

Can you test with two Arduinos instead of one Arduino and the FLIR? You can't tell if that continuous MISO signal is the FLIR trying to transmit something you don't expect.

How far do you want to go? Standard SPI will go 10-20 feet easily. I've never tried more but I expect it will work.

Are you sure? That's a Due with a clock divider of 5, so ~ 17MHz clock frequency. I never tried but if my knowledge about the American length units is more or less correct, 20 feet is about 6 meters. I got problems with an SPI bus at 5V using ribbon cables at 1 meter and that was an Arduino 4MHz signal.

If I add up the driver and receiver switch times I get a theoretical maximum speed of about 20MHz, given the cable capacitance is below 30pF, I guess with the 10cm you should stay below that value.

Provide a schematic of that setup. Did you use the correct driver/receiver order for that pin? It's the only one going the other way. And remember that the MISO pin is in high-impendance state on the slave side if CS is HIGH. I cannot see the actual signal curve on the pictures you posted.