signal integrity and impedance matching

Go To Last Post
34 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Over several years of work with 8-bit AVRs, I've never had problems with signal integrity, even when running signals up to 3Mhz over 50cm long ribbon cable.  Over the past couple weeks, I've been building a SWD probe using a CH552 (8051) MCU, and have encountered repeated communications problems.  I did have a flaky solder joint on one of my connection, but after fixing it the communications problems persisted.  After noticing a lot of ringing, I tried adding 68-Ohm series resistors on SWCLK and SWDIO, which eliminated the problems.  I'm somewhat limited by the 1Gsps resolution of my scope, but I can tell the CH552 has much faster rise times, around 1-2ns, than the AVR parts I'm used to using that are around 3-4ns.  I measured the output impedance of the CH552 IO at about 80Ohms.  The AVRs I've used have around 25Ohm output impedance, which implies much bigger FETs on the output totem pole, and therefore higher gate capacitance and slower switching times.  The CH552, like 8-bit AVRs, has no slew rate control.

 

I suspect the 28AWG 0.1" dupont jumper wire ribbon cable I'm using has an impedance around 150 Ohms, so the 68Ohm series resistors should make for good impedance matching.  I still see some overshoot, which after reading up on transmission lines I understand is to be expected given the high impedance at the receiver.   Since the transmit side is impedance matched, I think the reflection from the receive side should be almost fully attenuated, and avoid the negative reflection back to the receiver that was likely causing excessive ringing before I added the series resistors.

 

Now that I've gone down this deep rabbit hole of velocity factors, inductive coupling, and capacitive coupling, I'm interested in understanding it as best I can.  I've seen other schematics where series resistors are used for impedance matching, and I've also seen schematics showing small caps (~100pF) which I assume are there to reduce both noise and slow rise/fall times.  My guess is the total capacitance of the SWCLK and SWDIO lines is around 30-40pF.  I'm wondering if it is a good idea to add capacitance as well.  If I understand the physics correctly, using low-impedance MLCC capacitors alone (without series resistors) would reduce the rise times but would increase the source impedance mismatch and therefore possibly increase the negative reflections back to the receiver.

 

When researching this subject I found a few resources like impedance calculators for PCB traces, but never saw anything relevant dealing with signals over cable assemblies.  Does anyone have any suggested reading material?  While some old papers discussing SCSI bus terminations and ATA-133 are interesting reading,  it's not that helpful for a SWD probe connecting to a target board with hiZ inputs.  I've read through the ARM SWD (ADI) spec, and there's surprisingly little consideration given to the physical layer.  It calls for a 100k pullup on SWDIO, but makes no mention at all of any signal timing such as minimum SWCLK high and low periods, rise/fall times, etc.

https://static.docs.arm.com/ihi0...

 

 

 

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not an expert, but I did like digging into that stuff a few years back, the classic question of what could be done to fix the Tacoma Narrows Bridge problem. I especially like analogies between mechanical and electrical systems. Sadly I don't have any suitable reference materials to link. The easy fix would be to drive the output (which would have some capacitance) so that it would slew, so not slamming it on/off, perhaps with a current source/sink. Burning off the energy in those high-frequency components after the fact is not practical, but maybe some ferrite could help, not sure; it never worked very well for me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ralphd wrote:
Does anyone have any suggested reading material?
in depth, Signal Consulting, Inc. - Dr. Howard Johnson

for first cut (education), AoE :

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

12.10 Driving Cables 858

 

edit :

P.S.

ralphd wrote:
The CH552, like 8-bit AVRs, has no slew rate control.
Follow-on AVR have slew-rate control.

Port Configuration | AVR® DB Family

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Jan 27, 2021 - 02:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 so the 68Ohm series resistors should make for good impedance matching. 

Have you tried terminating at the rcvr with some impedance, maybe 200 ohms?

 

https://www.onsemi.com/pub/Colla...

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

See the further notes in: AVR output curves | AVR Freaks

 

Howard Johnson is THE guru on this matter.

 

The short answer is that for rise times longer than a few nanoseconds, inputs with a zero threshold of about 0.3*Vcc and a one threshold of about 0.7*Vcc, and inputs that are sampled at 25MHz or slower clock rates, it does not matter one diddly-squat.

 

And, yes, Galloping Gertie was a wonder in the wind! But the Tacoma Narrows bridge, however interesting, is really irrelevant to this discussion.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Wed. Jan 27, 2021 - 06:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
however interesting, is really irrelevant to this discussion.

 

Force and velocity vs. current and voltage can sometimes give insight, but you got to dig springs and weights as much as inductors and capacitors.

 

AT&T Archives: Similiarities of Wave Behavior

 

https://youtu.be/DovunOxlY1k

 

SCSI is differential like RS485, and the termination at the line end burns off the energy, so none is left for reflection; it is not clear to me how a half-duplex pin (e.g., SWDIO) could be set up to burn off the energy that would cause a reflection (snubber circuit?)

Last Edited: Wed. Jan 27, 2021 - 07:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

ralphd wrote:
Does anyone have any suggested reading material?
in depth, Signal Consulting, Inc. - Dr. Howard Johnson

for first cut (education), AoE :

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

12.10 Driving Cables 858

 

 

Thanks.  I think I recognize some of the Johnson articles from reading EDN.  Good stuff.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

 so the 68Ohm series resistors should make for good impedance matching. 

Have you tried terminating at the rcvr with some impedance, maybe 200 ohms?

 

https://www.onsemi.com/pub/Colla...

 

I can control the debug probe design, but not the target board design.  And a 200Ohm pulldown on SWDIO overpower the 100k pullup recommended in the ADI spec.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

The short answer is that for rise times longer than a few nanoseconds, inputs with a zero threshold of about 0.3*Vcc and a one threshold of about 0.7*Vcc, and inputs that are sampled at 25MHz or slower clock rates, it does not matter one diddly-squat.

 

Agreed.  Which is why I never encountered these problems before.

 

What's different about this situation is that the CH552 rise/fall times are sub 2ns.  Maybe 1ns, but I can't really tell with a scope that maxes out at 1Gsps.  The other difference is that ADI specs the external interface for SWD to be a really simple (and therefore fast) shift register.   With the HK32F030M, I've observed a 2ns crosstalk blip on SWCLK get recognized as half of a clock cycle, skewing the data by one bit.  That means the target's shift register able to clock data at ~250MHz.

 

I will note that even with AVR MCUs, the hysteresis is much smaller than your theoretical 0.3*Vcc to 0.7*Vcc.  For the classic AVR parts I've used like the ATMega328P, hysteresis from is about 0.1* Vcc.

 

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This was on Hackaday recently.  It has animations demonstrating inductive and capacitive crosstalk.

https://www.youtube.com/watch?v=...

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That crosstalk video was interesting; I had not seen it. If I understand, then a ribbon cable might be set up so that the magnetic and capacitive components cancel to the far (e.g., no crosstalk pulse.) If that were true, then the clock line would not affect the far, and the effect to the near side is smeared across time (so to speak), so it can not build anything substantial. Wow, that would be impressive if true. Are there discontinuities of the ribbon cable (with SWDIO, SWCLK)? Sadly I often shred mine and weave the wires into a blob of hot glue.

 

Update: just to add that that I was thinking the hot glue would be a dielectric discontinuity and do things sort of like the notch in the stripline in that video.

Last Edited: Wed. Jan 27, 2021 - 10:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ron_sutherland wrote:

That crosstalk video was interesting; I had not seen it. If I understand, then a ribbon cable might be set up so that the magnetic and capacitive components cancel to the far (e.g., no crosstalk pulse.) If that were true, then the clock line would not affect the far, and the effect to the near side is smeared across time (so to speak), so it can not build anything substantial. Wow, that would be impressive if true. Are there discontinuities of the ribbon cable (with SWDIO, SWCLK)? Sadly I often shred mine and weave the wires into a blob of hot glue.

 

Since there is no standard pinout, I use cables like these to connect GND, VCC, SWDIO and SWCLK to the correct pins on the target board.

https://www.fasttech.com/product...

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The defacto standard is the arm 10 pin connector. They put a 0V wire between the signals. This limits crosstalk.
Something else to consider is the scope lying to you. Probe setup is critical.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
The defacto standard is the arm 10 pin connector. They put a 0V wire between the signals. This limits crosstalk. Something else to consider is the scope lying to you. Probe setup is critical.

 

Is this the connector you are referring to?

https://cdn.sparkfun.com/assets/...

 

The STM32Nucleo boards have a 6-pin header for SWD.  The blue pill STM32F103 boards have a 4-pin header.  The new Raspberry Pi Pico has a 3 pin SWD header (GND, SWDIO, SWCLK).

[edit: I forgot the obligatory xkcd reference] https://xkcd.com/927/

 

As for my scope, I know it wasn't showing me how bad the crosstalk and ringing was.  Testing the capacitance of the probes was one of the first things I did with my DS1054Z.

http://nerdralph.blogspot.com/2015/10/parasitic-capacitance-of-avr-mcu-pins.html

The extra ~14pF of capacitance from my probes slows down the rise time and made it harder to capture instances when poor signal quality on SWCLK was being misinterpreted as a double clock cycle.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

Last Edited: Thu. Jan 28, 2021 - 01:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
The defacto standard is the arm 10 pin connector

This: https://documentation-service.ar... - table at the end gives  Samtech (sic) reference

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is more likely the scope is displaying the ringing as being worse than it really is. The probe earth clip is the main culprit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
The extra ~14pF of capacitance from my probes slows down the rise time and made it harder to capture instances when poor signal quality on SWCLK was being misinterpreted as a double clock cycle.
Most digital has low enough impedance to drive a 1K ohm resistor.

Probing High-Speed Digital Designs

DC to 1GHz Probe

 


MSO1000Z_Datasheet.pdf

 

Adaptor 50 Ohm ($18.00) : Saelig Online Store

Terminator feed-through 50-ohm BNC

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
It is more likely the scope is displaying the ringing as being worse than it really is. The probe earth clip is the main culprit.

Then why would attaching the probe clips often make the problem go away?

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Then why would attaching the probe clips often make the problem go away?

Scope probe gnd wire leads should be avoided when investigating pulse-based noise or ringing...connect the probe barrel directly to the PCB, or use a BNC cable instead of a probe...then what you see is more like what it is.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Thu. Jan 28, 2021 - 06:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Scope probe ground leads are the NUMBER ONE cause of apparent pulse ringing. 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A "ground spring" oscilloscope probe accessory can reduce the ringing.

 

 

If the scope makes the problem go away, though, that is evidence in itself. Maybe it is acting enough like a snubber circuit to burn off some energy that would otherwise cause unhelpful standing waves or nodes interference.

Last Edited: Thu. Jan 28, 2021 - 07:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


ron_sutherland wrote:
A "ground spring" oscilloscope probe accessory can reduce the ringing.
Likewise by a probe tip adapter.

Passive Probes | Tyrosys Corp | Apple Authorized Service Provider

[2/3 page]

TEX-BA

...

[bottom]

TEX-SA

Probe Tip Spring Adapter

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What order are the signals on the ribbon cable? Are SWDIO & SWCLK adjacent? It's common practice to interleave power and ground with high-speed signals to reduce crosstalk.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are not probing all around, just wrap a few turns of solid wire around the probe barrel & solder it to the nearest gnd point (or solder the wire, then twist it around the probe)....key thing is, keeping connection length as short as possible.

 

Toss aside the witches hat, unless you just want to wear it.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Thu. Jan 28, 2021 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

balisong42 wrote:

What order are the signals on the ribbon cable? Are SWDIO & SWCLK adjacent? It's common practice to interleave power and ground with high-speed signals to reduce crosstalk.

 

 

I'm using the SCK and MISO pins on the CH552, which happen to be adjacent to each other.  When I design the PCB, I may separate them for that reason.

Unfortunately the "defacto standard" has SWDIO and SWCLK adjacent to each other:

 

I plan to implement CDC serial in addition to CMSIS-DAP HID, so my current idea for the probe pinout is a 2x5 0.1" male connector as follows:

row 1: nRST, SWCLK, G, SWDIO, 3V3

row 2: DTR, Rx, Tx, VDD, G

VDD will be a choice between 3V3 or 5V.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
"defacto standard" has SWDIO and SWCLK adjacent to each other:

 

On the ribbon cable, does GND 3 end up between 2 and 4?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ron_sutherland wrote:

ralphd wrote:
"defacto standard" has SWDIO and SWCLK adjacent to each other:

 

On the ribbon cable, does GND 3 end up between 2 and 4?

 

Good point.  With IDC cable that should be the case.

 

I'm still planning on using 0.1" male headers on the probe since few ARM MCU eval boards use the 0.05" cortex debug connector, and because it doesn't have any UART pins.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
The STM32Nucleo boards have a 6-pin header for SWD.  The blue pill STM32F103 boards have a 4-pin header.  The new Raspberry Pi Pico has a 3 pin SWD header (GND, SWDIO, SWCLK).

 

My current ARM board uses the Nucleo header (only five pins are used, though) simply because I will be using a Nucleo to program it. I have found the reset signal useful in the past and it costs me nothing to include it.

 

Previous commercial designs have used an 0.05" 2x5 header which provides the SWD etc plus serial in and out; for production, pogo pins go straight to the footprint but for development the pin header is fitted. The tiny wire goes to an adaptor board which breaks out the serial leads to a USB port while passing the programming/debugging pins unchanged to a J-link.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just noticed that Dave did a video about scope probes.  In addition to mentioning the ground springs, he discusses how much the probe capacitance contributes to high frequency attenuation.  The part that I hadn't heard of before was making your own probe with a piece of coax and a resistor.

https://www.youtube.com/watch?v=...

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you really want to subject us to a dose of Dave??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The part that I hadn't heard of before was making your own probe with a piece of coax and a resistor.

#19 mentioned to use a BNC arrangement ...it often works nicely on a decent scope...you still need to use care in setup to avoid being back in the same situation.

  connect the probe barrel directly to the PCB, or use a BNC cable instead of a probe...then what you see is more like what it is.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ron, it’s a toss up as to which is more tolerable!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

forthcoming though for 1GHz digital or USB3 :

TSP #182 - Antikernel Labs Inexpensive Multi-GHz Transmission Line Probe Review & Experiments - YouTube (19m29s)

 

Andrew Zonenberg

...

Expected retail price (not including tax/shipping) will be:

 

* $250 for standard edition (probe body and basic grounding accessories only), discounted to $150 to students / noncommercial users upon special request

 

* $550 for pro edition. This will include an SMA cable, SMA-BNC adapter, and full characterization report including machine readable S-parameters for de-embedding probe response from your measurements. Based on this review, I may also include a set of pogo tips you can use instead of the rigid ones.

similar though AC-coupled :

P-20B 12 GHz RF probe | AUBURN Products Page

 

"Dare to be naïve." - Buckminster Fuller