Impedance matching ...

One thing I have yet to grasp is the idea of 'impedance matching'. I'm building a small LED panel using WS2803 drivers (it's the bigger brother of the WS2801s). For both of those ICs, the datasheet talks about impedance matching 'at the data input or output port'. It's that sentence I don't understand.

If I think about how SCSI cables were terminated, it was always done at the very end of the line. This makes sense to me. So what is the proper, English translation of what they're trying to say with the sentence above? Should I add resistors at the data/clock OUT port on the last IC? (datasheet says 50 Ohm resistors) Or should I be adding them after EACH IC? (which would go against how you'd terminate a SCSI cable, but then we aren't talking the same thing here.)

And the part other about impedance matching itself that I need to understand is how those resistors are wired. Are they pull-ups (to +5V), or pull down to GND? Does it matter whether the ICs are driven through SPI or bit banging?

As the data is not distributed as a bus (like scsi), but in-between the chips, you'd need a resistor for each part of the way.

Termination to either GND or Vcc should work. Personally I'd use GND, feels better :wink:

madworm:
As the data is not distributed as a bus (like scsi), but in-between the chips, you'd need a resistor for each part of the way.

Okay, can you go into a little bit more detail? When you say 'distributed data' ... I presume you're referring to the protocol used, which in this case would be SPI. It's just sending stuff out (using MOSI), there's nothing coming back through MISO (and if there was, well though because it's not wired to begin with.) Is that what you mean, that it's a one-way thing, cascading from one to the next?

In scsi all devices were attached to the data lines with a T-joint - just like the old BNC ethernet. The end is terminated to prevent reflections (traveling 'left') to interfere with real data traveling 'right'.

The data on MOSI goes into IC1 (and possibly gets reflected back to the µC), is processed in IC1 and fed out on the other side to IC2, goes into IC3 (...all the reflection business again there...), and so on and so forth. Therefore each wire needs its own termination.

It's too long ago that I actually dealt with this business to remember if the problem is created by the first reflection right at the receiver or by the 2nd one at the sender that would / could interfere with new data coming out of it. A bit of thinking / reading might clear that up.

Anyhow, you can think of a situation when the 2nd reflection would interfere with a new packet of data. And that at least depends on the wire length, signal speed, time between the data packets... I think it doesn't matter if the wavelength of the bit is much larger than the transmission line. But as I said, it's long ago that I thought about things like that.

Regarding the one-way-thing:

The 'good' data only goes one way, but if there is an impedance mismatch at any point, you get "ripples" going back on the same line. Possibly bouncing back and forth a couple of times until they decay into nothingness.

Doesn't the datasheet say the terminations are needed if the distance is 'longer', and not needed for short interconnections?

CrossRoads:
Doesn't the datasheet say the terminations are needed if the distance is 'longer', and not needed for short interconnections?

Yes it does, and these panels can (and probably will) be daisy chained in the end. So eventually one will hit that "longer" mark, whatever it might be. So if all it takes is to add a 2 cent part between ICs, regardless of length, then I'm doing it. :slight_smile:

madworm:
The data on MOSI goes into IC1 (and possibly gets reflected back to the µC), is processed in IC1 and fed out on the other side to IC2, goes into IC3 (...all the reflection business again there...), and so on and so forth. Therefore each wire needs its own termination.

Aah, gotcha. So I can stick it in between each IC then (as well as between the MCU and first IC.) And I think I will just pull it down to ground, I mean there's no advantage of going either way, is there (VCC versus GND)?

The data is daisy-chained and can be terminated at the input of each module.

However the clock is a bus and that should be terminated at the end of the line I would think.

How long will the final run be and how fast is the data rate, that will determine if you need termination. if the run is going to be long maybe look into RS485.

no advantage of going either way, is there (VCC versus GND)?

I don't think it matters, as madworm says it just feels "right" to terminate to GND though :slight_smile:


Rob

Graynomad:
The data is daisy-chained and can be terminated at the input of each module.

See, that's the part that doesn't make sense to me. To me "terminated" means exactly that, it's terminated meaning end, dead stop, go no more. No data can get past it. So that's why it makes no sense to me to say "terminate" at the input port. :slight_smile:

Graynomad:
However the clock is a bus and that should be terminated at the end of the line I would think.

Would make sense, but then, again, with my thinking of how "terminate" works, that would also mean the signal doesn't go anywhere after that and can't reach another module that's daisy chained. (note, each module will have several of the LED drivers on it.)

Graynomad:
How long will the final run be and how fast is the data rate, that will determine if you need termination. if the run is going to be long maybe look into RS485.

For all intents and purposes, one module will have 4 led drivers in it, and they're sitting within millimeters of each other. Traces from one to the other (taking into account that some will travel around the IC itself) might be about an inch long. However, the next module might be a foot away or it could be ten feet away.

My experience with terminating digital signals were mostly in regards with RS-485 circuits that were using twisted pair wiring which has a characteristic impedance of I think 120 ohms. These were long runs of maybe 1K-2K feet with possibly a dozen 'nodes' in all. The proper method to insure the line was terminated to it's characteristic impedance was to have a resistor at the first and last physical location of the run. The nodes usually had dip switches or jumper clips that would allow a resistor to be placed across the cable pair, and we would just turn them all off except the first and last devices on the bus.

This looks to be a decent write up on the subject on the why and how of proper signal cable termination including scope drawings:

Lefty

to me "terminated" means exactly that, it's terminated meaning end, dead stop, go no more.

Which is exactly what's happening. You don't have one long cable run you have 10 (or whatever) short ones, each is totally separate from the others in the physical sense. The only way they are connected is logically, ie the data flows down the line, but physically you have multiple short runs and they are independent of each other.

So each one is indeed terminated, the input to each WS8201 is the end of the line, a new line starts at the output.

Forget what I said about the clock signal, I forgot that the WS8201 chips propagate the clock, it's not shared on a bus.

Traces from one to the other (taking into account that some will travel around the IC itself) might be about an inch long.

At the speeds you'll be using you can ignore any on-PCB traces.

However, the next module might be a foot away or it could be ten feet away.

Even at 10 feet I think you will be OK with the WS8201 driver outputs. I don't think RS485 is justified and I also don't think termination will be a big deal, just allow for resistors on each signal.


Rob

Graynomad:

However, the next module might be a foot away or it could be ten feet away.

Even at 10 feet I think you will be OK with the WS8201 driver outputs. I don't think RS485 is justified and I also don't think termination will be a big deal, just allow for resistors on each signal.

And that's kinda what I was thinking. If I put the pads (actually through hole would be easier) on the PCB, I can leave them unpopulated and if I run into problems, I can always add the resistors later and hope for the best. Or just add the damned resistors with a switch to turn them on or off. So the consensus is to add the datasheet recommended 50 Ohm resistor on the data and clock lines, pulling them to GND.

And I think, I can get away with only adding it on the last driver on the same PCB (or module). Because they all sit so close to each other, I doubt there would be problems. It's once I start adding more and extend the distance between each module, that's when I may run into issues.

I'm sure you'll let us know if it works :wink:

And adding a small resistor footprint just in case doesn't cost much either, no it potentially saves you from pulling out hair (if you have some left).