Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:08 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

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

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 04:39am 30 Jul 2025
Copy link to clipboard 
Print this post

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!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:42am 30 Jul 2025
Copy link to clipboard 
Print this post

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

Jim
VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 05:52am 30 Jul 2025
Copy link to clipboard 
Print this post

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.
Smoke makes things work. When the smoke gets out, it stops!
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 06:35am 30 Jul 2025
Copy link to clipboard 
Print this post

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
PicomiteVGA PETSCII ROBOTS
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1384
Posted: 06:41am 30 Jul 2025
Copy link to clipboard 
Print this post

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.


 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7938
Posted: 07:01am 30 Jul 2025
Copy link to clipboard 
Print this post

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.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:52am 30 Jul 2025
Copy link to clipboard 
Print this post

  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....
Smoke makes things work. When the smoke gets out, it stops!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 08:15am 30 Jul 2025
Copy link to clipboard 
Print this post

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
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 04:20pm 30 Jul 2025
Copy link to clipboard 
Print this post

@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
PicomiteVGA PETSCII ROBOTS
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2950
Posted: 11:02pm 30 Jul 2025
Copy link to clipboard 
Print this post

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



.
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1384
Posted: 09:51am 31 Jul 2025
Copy link to clipboard 
Print this post

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
 
Print this page


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