![]() |
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 ZealandPosts: 9610 |
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: AustraliaPosts: 6283 |
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 ZealandPosts: 9610 |
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: NetherlandsPosts: 5091 |
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 KingdomPosts: 1384 |
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 KingdomPosts: 7938 |
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 ZealandPosts: 9610 |
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: AustraliaPosts: 2642 |
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: NetherlandsPosts: 5091 |
@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: AustraliaPosts: 2950 |
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 KingdomPosts: 1384 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |