I've made a 2 letter 7 segment display using this LED driver


when I connect it with a 10-20 cm cable to my MCU board it all works OK, but fails when on about 2 m. also I have 3 other mosfet outputs going through the same cable, the cable is YSLCY 10 x 0.5 so there's 10 wires:

  1. MOS1 GND
  2. MOS2 GND
  3. MOS3 GND
  4. MOS and 7SEG shared +12V
  5. GND
  6. +3V3
  7. LA
  8. OE
  9. SCK
  10. MOSI

enter image description here

the cable is shielded, so it should be good from outside EMI, but fails miserably as I recently found out, especially when I also switch ON any of the PWM MOSFET outputs.

Later on I tried to separate the mosfet outputs from the signal part, and it was a bit better, but still not acceptable. I've read about using twisted pair cables, termination resistors, ribbon cables, not exactly sure if that would work.

Also application note here https://www.st.com/resource/en/application_note/dm00038253-led-array-drivers--stmicroelectronics.pdf on page 52, mentions filtering, also not sure what to do.

So looking for help or a guideline on what to do??

If I cannot fix the SPI noise, I was thinking of putting LED driver to my MCU board and connect the 16 LED outputs with cable to my LED series (hoping that would not have interference as well), or just use something else other then SPI

  • 1
    \$\begingroup\$ Is that the full schematics? Not a single bypass cap? \$\endgroup\$ – Justme May 12 at 7:26
  • \$\begingroup\$ no, where should I put them, and what values? the whole thing is powered by a 12V battery \$\endgroup\$ – Seeker May 13 at 10:21
  • \$\begingroup\$ For starters, you must at least put a 100nF capacitor at the chip power supply pins 1 and 24, and then go read about bypass caps. But that may not be enough to solve your problem, and you have not told much about your design. I mean, what SPI clock rate you are even using, and are you expecting it to simply work by connecting two chips directly together over bulk 2 meter cable without any special precautions? \$\endgroup\$ – Justme May 13 at 10:47
  • \$\begingroup\$ ok, did that, the brightness is now a lot better. the clock rate ive lowered to 1khz from 4mhz also seems better. \$\endgroup\$ – Seeker May 13 at 15:32

Please, read the answer of tcrosley here: SPI max distance. Typically, maximum distance of SPI interface is about 10-25 cm (4-10 inches). On long cables you should take into account not only outside EMI noise, but also great impact of (relatively) high capacitance of the wires themselves.

Also it is highly recommended to read this article: Extending the SPI bus for long-distance communication

If you want longer communication cable, you can try the simplest following solutions:

  1. Decrease speed communication to absolute minimum (generally below 100 kHz).

  2. Add terminal resistors of about 120 ohms to the lines.

  3. Add RC filter to your lines (values are depending on the bus frequency).

Also add 0.1uF decoupling capacitors to you remote SPI chips (I don't see it on your schematics) as well as high capacity electrolytic filtering capacitor for power supply lines.

| improve this answer | |
  • \$\begingroup\$ the terminal resistors at the source? not much i can do now for this batch, ill update the schema and fix that in subsequent batch \$\endgroup\$ – Seeker May 13 at 15:50
  • \$\begingroup\$ the terminal resistors and RC filter at the source or end? also where do i put the electrolytic, on the MCU board or the seven segment board? \$\endgroup\$ – Seeker May 13 at 16:07

You did say the crosstalk fails miserably, but not where it was messed up e.g. the SPI channel for characters, the segments or crosstalk or aliasing.

Each LED segment is an input, but driven by an open drain that should be high impedance when dark. But cable coupling capacitance of 30pF/ft or 100pF/m est. at the mux rate is causing cross talk along with PWM dimming.

The SPI is driven by a bipolar driver so it is 50 Ohms or so. The PWM could be not bipolar driven but the rise time = 0.35/f-3dB can be used to compute the crosstalk signal current equivalent with the perceived ghosting you see.

  • 1 Assuming you have a clean supply , you can try to reduce the common mode noise by earth-bonding the shield at one end near the DC power source.

  • 2 Then you can reduce the Off impedance using segment driver pullup resistors such that the cross voltage you compute above times the resistor you choose results in noise <<5% current or better. THis also reduces brightness, so some tradeoff is needed such as 1kOhm.

  • 3 You can use the DC Iset control for dimming instead of PWM.

  • 4 Isolate the PWM drivers from the SPI cable.

  • 5 Most important: Terminate Twisted pair SPI signal with 150 ~ 220 Ohms and confirm signal integrity.

  • 6 Try adding a series 100R/100p RC snubber to SPI signals. Failing this show photos of signal integrity with schematic using twisted pairs for each signal. etc.

Matched impedance becomes critical for long fast rise time signals. Cable Impedance matters.

| improve this answer | |
  • \$\begingroup\$ ok, i isolated the PWM drivers, put them on a separate cable, and grounded the signal cable shield, it appears to be working now \$\endgroup\$ – Seeker May 13 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.