Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : Can you get away with long leads on SPI?

Posted: 04:39am
30 Jul 2025
Copy link to clipboard
Grogster
Admin Group


Specifically thinking of an 4" SPI ST7796 display, but I need to mount it away from the main system box by around 3 meters or so.

SPI, like I2C etc, is really only designed to connect between chips on the same board, or on boards close together in the same box - how far do you think you can push SPI in terms of cable length?

I DO PLAN to simply hook up a MM2 chip and run some tests, but perhaps someone else already has, and has the data to share.

With this LCD, I'm only wanting to write to it.  Not interested in any kind of reading or fancy features.  Touch isn't being used, SD card isn't being used.  The only thing on the bus, will be this one single LCD module.

I have a contingency plan if raw SPI does not like travelling the distance, but it would be the easiest solution to just extend the SPI lines out....
Smoke makes things work. When the smoke gets out, it stops!
 
Posted: 05:42am
30 Jul 2025
Copy link to clipboard
TassyJim
Guru


It will depend on SPI speed, cable specs and termination but 3M should be OK

Jim
 
Posted: 05:52am
30 Jul 2025
Copy link to clipboard
Grogster
Admin Group


Based on that, I will take the time to setup a bench-test then.
I'll post back with the results, when I have them.
 
Posted: 06:35am
30 Jul 2025
Copy link to clipboard
Volhout
Guru

With the speed of light around 3ns per meter, 3 meter would be 9ns. For a roud trip clk send, miso read that would be 18ns. When the signals are perfect, clk duty cycle 50%, mode 0 spi, this cpuld theretically work up to 28 Mhz (36ns).

But

Not sure what spi clock peter uses.

But: in a cable the speed is more like 4 to 5 ns per meter. So even with 16Mhz clock you would run into problems.

getting these signals perfect over 3 meters may require more circuits ( termination, cable matching) may require more than adding a pico right at the display, and running a 3 meter serial cable.

Volhout
Edited 2025-07-30 17:59 by Volhout
 
Posted: 06:41am
30 Jul 2025
Copy link to clipboard
PhenixRising
Guru

Probably a bit extreme but BiSS C is very similar to SPI (clock/data) but with differential transceivers.

I'll need to tackle this at some point.


 
Posted: 07:01am
30 Jul 2025
Copy link to clipboard
Mixtel90
Guru


It'll be interesting to see how well this works. Ultimately it's cable capacitance that's the problem. The current drive capability of the signal drivers has to attempt to overcome this.
 
Posted: 07:52am
30 Jul 2025
Copy link to clipboard
Grogster
Admin Group


  Volhout said  ...may require more than adding a pico right at the display, and running a 3 meter serial cable.

Volhout


That is exactly my contingency plan - well spotted.  
Perhaps I'll just do that anyway, if there is any chance that I am pushing things trying to force SPI over that length of cable....
 
Posted: 08:15am
30 Jul 2025
Copy link to clipboard
phil99
Guru


Cat5e or Cat6 cable will give you the best chance. To minimize crosstalk pair MOSI and CLK with an earth each.
The others are less important but if there are spare wires pair some of them with earths too.

For shielding signals Vcc can be regarded as an earth also.
Edited 2025-07-30 18:17 by phil99
 
Posted: 04:20pm
30 Jul 2025
Copy link to clipboard
Volhout
Guru

@phil,

Timing kills it. The pico sends a falling clock when it expects valid MISO data to clock in. But due to cable length that data appears 30ns later.

If you use the display without miso, you may get away with it. But some basic commands wont work.

Same for touch.

Since cat5 cable is around 100 ohm, it would be best to terminate each signal with 100 ohm in series with 47pf.

Volhout
Edited 2025-07-31 02:30 by Volhout
 
Posted: 11:02pm
30 Jul 2025
Copy link to clipboard
bigmik
Guru


Hi All,

Grogs, you may be better off having a Pico mounted to the back of display and send commands to it from a remote (even hc12) unit… similar to my serial backpack idea..

Regards,

Mick



.
 
Posted: 09:51am
31 Jul 2025
Copy link to clipboard
PhenixRising
Guru

I like my displays to be portable and work >10m away which is why I use an Android device + RFO BASIC (interpreter).

      -Tons of memory and storage
      -Processing power + GPU
      -Battery backup
      -WiFi
      -Bluetooth
      -Already in a nice enclosure
      -Updating is OTA
      -Capacitive touchscreen

I don't know anything about browser UIs but maybe that's an alternative, using WebMite(?)

 
Edited 2025-07-31 22:36 by PhenixRising
 


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025