Author Topic: Advice on connector pin out (SPI bus + Power)  (Read 1102 times)

0 Members and 1 Guest are viewing this topic.

Offline danielbriggsTopic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: gb
Advice on connector pin out (SPI bus + Power)
« on: October 12, 2020, 02:08:43 am »
Hi there,
I wondered if I could ask for some advice on the best way to pick a pinout for a connector for a project I'm working on // if what I am planning is sensible.


Short:
Is it wise to bunch up all data pins consecutivly with one GND conductor, or interlace them with GND's every other pin?


Long:
I have a dozen sensors each communicating over SPI @48MHz bus speed, controlled by one central micro, and each of these sensor nodes are separate physical units inside an overall large enclosure. The maximum distance between all nodes from the central controller is 1m. While it would be very nice to daisy chain all the nodes, I think this would be problematic (although please correct me if I'm wrong).
So I'm planning to use a star topology with each sensor node making a point-to-point connection with the main micro-board. This adds more wire clutter inside the enclosure, and takes up more connector space on the main controller, but I believe this will give me central point grounding, and consistent wire lengths so there is no skew on the (relatively fast, - by my standards at least!) SPI bus. Please correct me if this is wrong.

So the signals to go out to each sensor node are SPI-CLK, SPI-MOSI, SPI-MISO, SPI-SS and 1x GPIO line [enable]. AND 24V and GND for power. (There is an onboard DC-DC on each sensor node to make required voltages).
By my maths this is a total of 7 signals, and naive me would have said "ok a 7-way connector will do". However after absorbing 1% of Johnson's High speed digital design - black magic,  I feel this might be non-optimal especially as there's a relatively fast SPI bus on there. I've read a few suggestions of staggering GND's between every other signal pin. Would you reccomend this applies here?

GND's every even pin, brings the total to 12-way wire-to-board connectors. Sensible + the way to go, or a waste of time, and keep it to the bare minimum of 7-way connectors?

Bonus question:
Is it wise to put both fast SPI signal and power (24V @ ~200mA) on the same cable assembly or a massive no-no? My aim was to keep it simple for wiring to each node, but if there's a good electrical reason to separate such then I can split it out to two cable assemblies.
I was planning to use 1.5mm JST ZH series for reference.


Any advice / pointers greatly appreciated.

All the best,
Dan
 

Online jbb

  • Super Contributor
  • ***
  • Posts: 1228
  • Country: nz
Re: Advice on connector pin out (SPI bus + Power)
« Reply #1 on: October 12, 2020, 08:27:25 am »
Err, 48 MBit/s over 1m could be a little difficult.

Some scoping questions:
  • Could you sketch what you'd like for a daisy chain and how you might do a star topology? A sketch can help a lot
  • What sort of other stuff is in the cabinet (or nearby)? DC motors? Tesla coil? Induction furnace? Arc furnace? Medical equipment?
  • An SPI link suggests you're connecting to some kind of IO chip. What could happen if a few bits of the SPI communication get flipped or a wire falls off? Could software fix that? Would reboot be require? Would something catch fire?
  • Would these cables be hot-plugged (i.e. plugged & unplugged while 24V power on)?
 
The following users thanked this post: danielbriggs

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8763
  • Country: fi
Re: Advice on connector pin out (SPI bus + Power)
« Reply #2 on: October 12, 2020, 08:39:18 am »
48Mbps SPI over 1m of wire is very challenging, SPI is not supposed to be used for this purpose at all.

This being said, if you want to try, I would recommend the following:

* Twisted pairs (like CAT5) where the pairs are MISO+GND, MOSI+GND, SCK+GND, NCS+GND; or
* flat flex cable, ribbon cable or similar, where every other conductor will be ground. Pinout like GND, VCC, GND, n x [VCC, GND, ] if more power is needed, then MISO, GND, MOSI, GND, SCK, GND...

Approximate the transmission line impedance, for 0.5mm FFC with ground-signal-ground-signal it's somewhere around 70 ohms.

Then, use 4-layer PCB on each end. Use a web calculator for trace width (knowing the prepreg thickness of the PCB stackup), matching it to the cable as well as your guesstimate of the cable impedance allows.

Then, use source (series) termination resistors. Subtract approx. 20-30 ohms for the IO pin ESR. So in practice this would be some 33R to 56R; experimentation and signal integrity measurements are needed. These resistors go at the driving end; so with MISO, it's right at the slave's pin, three others are at the master.

Do not share the bus, only point-to-point allowed (otherwise the source termination doesn't work as expected). Pick a master MCU with a lot of SPI peripherals; if this doesn't work out, use bus switch/matrix ICs to isolate all except one path at a time.

It's OK to combine a few slaves to the same bus if they are a few cm from each other on the same PCB.

Finally, re-evaluate if you really need 48MHz. Going slower will allow you to slow down edges more, by increasing R and/or adding small filter C at the receiving end.
« Last Edit: October 12, 2020, 08:41:56 am by Siwastaja »
 
The following users thanked this post: danielbriggs

Online jbb

  • Super Contributor
  • ***
  • Posts: 1228
  • Country: nz
Re: Advice on connector pin out (SPI bus + Power)
« Reply #3 on: October 12, 2020, 09:44:30 am »
48Mbps SPI over 1m of wire is very challenging, SPI is not supposed to be used for this purpose at all...

Do not share the bus, only point-to-point allowed ... Pick a master MCU with a lot of SPI peripherals; if this doesn't work out, use bus switch/matrix ICs to isolate all except one path at a time...

Finally, re-evaluate if you really need 48MHz. Going slower will allow you to slow down edges more, by increasing R and/or adding small filter C at the receiving end.

Yep. What he said. You're getting into transmission lines, which is doable but needs some care.  Connectors will be quite important, because you'll need controlled impedance.

Two options come to mind:
  • You could do SPI messages over Low Voltage Differential Signalling (LVDS). Differential is good for emitting less noise from your equipment and . Multidrop LVDS (M-LVDS, MLVDS) might allow for a daisy-chain cable approach but would have greater risk of problems.
  • If you can slow down to 1Mbit/s, Analog Devices (aka Linear Tech) make something interesting: the LTC6820 isoSPI interface.  This uses assorted modulation tricks and isolation transformers to squeeze an SPI connection through a single twisted pair
 
The following users thanked this post: danielbriggs

Offline danielbriggsTopic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: gb
Re: Advice on connector pin out (SPI bus + Power)
« Reply #4 on: October 12, 2020, 12:16:20 pm »
Thank you both for taking the time to reply + educate me; really appreciate it.

Could you sketch what you'd like for a daisy chain and how you might do a star topology? A sketch can help a lot
For sure, I've sketched out the use case here:  1087476-0
For reference, I've made a previous incarnation of this system with a slower 1MHz SPI bus in a daisy chained fashion, and it works very well. However there is a need to update the system + replace with newer sensors that require a faster transmission rate, so I would like to do whatever I can to engineer this 48MHz bus properly.

I have rethought the positioning slightly, and by placing the controller in the middle of the nodes, I can shorten the cable length to 500mm from MCU to each node.





* flat flex cable, ribbon cable or similar, where every other conductor will be ground. Pinout like GND, VCC, GND, n x [VCC, GND, ] if more power is needed, then MISO, GND, MOSI, GND, SCK, GND...
Thank you, that confirms my suspicion of needing the extra interleaved GND's.



Then, use 4-layer PCB on each end. Use a web calculator for trace width (knowing the prepreg thickness of the PCB stackup), matching it to the cable as well as your guesstimate of the cable impedance allows.
Then, use source (series) termination resistors. Subtract approx. 20-30 ohms for the IO pin ESR. So in practice this would be some 33R to 56R; experimentation and signal integrity measurements are needed. These resistors go at the driving end; so with MISO, it's right at the slave's pin, three others are at the master.
Thank you for this; most helpful. I've never designed a 4-layer board, but was intending to make this my first (for the various benefits I've read about). Planned: SIGNAL, GND, VCC, SIGNAL stackup.



[If you can slow down to 1Mbit/s, Analog Devices (aka Linear Tech) make something interesting: the LTC6820 isoSPI interface.  This uses assorted modulation tricks and isolation transformers to squeeze an SPI connection through a single twisted pair
I've never heard of such a product before; thanks for the heads up on that. I'll give it a good read, and useful to know if even not for this project.



What sort of other stuff is in the cabinet (or nearby)? DC motors? Tesla coil? Induction furnace? Arc furnace? Medical equipment?
Nothing too noisy like that. Just an off the shelf AC-DC switching PSU.


Would these cables be hot-plugged (i.e. plugged & unplugged while 24V power on)?
No hot-plugging.


All the best,
Dan
« Last Edit: October 12, 2020, 12:18:50 pm by danielbriggs »
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 2420
  • Country: gb
Re: Advice on connector pin out (SPI bus + Power)
« Reply #5 on: October 12, 2020, 12:22:25 pm »
Maybe at 500mm line length you can get away with this, but then the client changes specification and wants 2m.
Can you put a microcontroller at every 'node' and have slower communications link back to the central controller?
 

Offline danielbriggsTopic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: gb
Re: Advice on connector pin out (SPI bus + Power)
« Reply #6 on: October 12, 2020, 12:47:03 pm »
Maybe at 500mm line length you can get away with this, but then the client changes specification and wants 2m.
Can you put a microcontroller at every 'node' and have slower communications link back to the central controller?

I thought about doing this, and looked at a system with like you said a MCU at each node, and CAN bus for them all to communicate on (Similar to the Omzlo implementation).
But to keep it simple, opt'd for a central MCU on this 0.5/1.0m system; there is no scope to do bigger system in my eyes. Any larger and it would need a different decentralised approach (CAN etc.)

Thanks for your thought on this though.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf