Author Topic: 22 ohm current limiting resistors for stm32 programming  (Read 5871 times)

0 Members and 1 Guest are viewing this topic.

Offline EteslaTopic starter

  • Regular Contributor
  • *
  • Posts: 155
  • Country: us
22 ohm current limiting resistors for stm32 programming
« on: November 05, 2021, 08:24:30 pm »
Hey guys. I noticed that all of the STM32 discovery and nucleo schematics that I find have 22 ohm resistors in series with the SWDIO, SWCLK, nRST lines used for programming. I have seen them referred to as current limiting resistors. I have a project that uses an STM32F0 microcontroller. I want to program it with one of these:
https://www.st.com/resource/en/user_manual/dm00026748-st-link-v2-in-circuit-debugger-programmer-for-stm8-and-stm32-stmicroelectronics.pdf

Do I have to include these 22 ohm resistors between the programming header and my microcontroller, or can I live without them? Experimentally I find that I can program just fine without them being there. I am wondering if there is some good reason to include them. There has to be some reason all the example discovery and nucleo boards use them right?

I hate including things if I don't completely understand why they need to be there. To me it seems digital signals do not require current limiting normally, and even if they did the 22 ohms would likely only limit the current to 3.3/22 = 150mA with seems high enough to cause damage anyways???

Thanks in advance!
« Last Edit: November 05, 2021, 08:28:25 pm by Etesla »
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #1 on: November 05, 2021, 08:39:01 pm »
Some designers include components into every new design just because someone else did once, or because some obscure design rules call for them ...

Anyway, in this particular case, the resistors serve a purpose: It's not current limiting as in DC current, but rather adding some damping to the signals. Fast signal edges can cause signal ringing and ground bouncing, depending on the layout and length of the traces or wires. At some point this leads to interferences or non-working circuits. Putting small valued resistors in series with the signals mitigates this. Usually you'd place them at the signal source (for unidirectional signals).

So in general it's not a bad idea to include them, but most probably you can live well without them and they're not necessary. They're better placed at the debugger end of the programming cable (so most probably they're already included in the ST-Link). Technically, the pin header you've shown above is the debugger end of the cable as this header is intended to debug an external target (if you open some jumpers on the nucleo board).
« Last Edit: November 05, 2021, 08:43:21 pm by capt bullshot »
Safety devices hinder evolution
 
The following users thanked this post: thm_w, I wanted a rude username, TimeGeek

Online Benta

  • Super Contributor
  • ***
  • Posts: 7056
  • Country: de
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #2 on: November 05, 2021, 08:42:09 pm »
^ This.
They are damping resistors.
 

Offline EteslaTopic starter

  • Regular Contributor
  • *
  • Posts: 155
  • Country: us
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #3 on: November 05, 2021, 08:57:00 pm »
Yup makes sense to me. Would a good way to verify that I don't need them be to probe the clk and data signals really well and see what I see. If I have peak voltages less than like .3V above and below the rails I would assume I'm safe without them?
 

Offline radar_macgyver

  • Frequent Contributor
  • **
  • Posts: 777
  • Country: us
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #4 on: November 05, 2021, 09:01:45 pm »
They also serve to limit fault currents if one accidentally puts a voltage > VCC on these pins (for example, an ESD event). This will turn on the I/O protection diodes and unless the current is limited, can blow them. Nice to have on I/Os that go off-board.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 9535
  • Country: ca
  • Non-expert
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #5 on: November 05, 2021, 10:27:00 pm »
This connector is for programming of *external* devices, via the onboard st-link, it has nothing to do with the internal STM32 on the board. as capt bullshot said.
Do not include them.

https://www.digikey.com/htmldatasheets/production/2365230/0/0/1/STM32-Nucleo-64-P-User-Manual.pdf
« Last Edit: November 05, 2021, 10:31:50 pm by thm_w »
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3141
  • Country: au
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #6 on: November 05, 2021, 11:23:37 pm »
Yup makes sense to me. Would a good way to verify that I don't need them be to probe the clk and data signals really well and see what I see. If I have peak voltages less than like .3V above and below the rails I would assume I'm safe without them?

It's not so much the peaks, but the ringing that can bite you, as that can cause double-clocking, which certainly gives programming issues :)

I've found  100~120 ohms series R can be needed, if programming over not-short ribbon cable with an external adaptor. Mostly the CLK pin needs it, and they are best on the driven end.

On other pins, such parts can help ESD or other oops events.  If you only want factory pgm, on a fixture with known short leads, it's probably ok to omit them
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 10890
  • Country: fi
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #7 on: November 06, 2021, 02:10:12 pm »
Google "series termination" or "source termination".

Usually doesn't matter. The interface is used on the lab table, with a short cable, and doesn't need to pass EMI regulations.

22ohms is better-than-nothing safety layer against accidental short circuits, and maybe a tiny improvement in ESD survival by limiting ESD current but this effect is almost negligible, I think.

I don't usually add such termination on the debug port unless it's going to be repurposed for something else.

For low-noise applications where you read a high-resolution ADC through SPI, for example, you may really want to add those 22ohm resistors. Or if you have a long trace of a piece of ribbon cable in a fast digital signal and want to pass EMI. In both examples, avoiding voltage peaks and oscillations from transmission line reflections is a good idea. You may also want to use slightly larger value if speed is noncritical.
 

Online dietert1

  • Super Contributor
  • ***
  • Posts: 2964
  • Country: br
    • CADT Homepage
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #8 on: November 06, 2021, 02:29:18 pm »
Nowadays it seems good engineering practice to systematically include EMI filters on all external interfaces. I have seen younger EEs do this without even asking whether it is necessary in each single case. Maybe they learn this at university.
The circuit should work if a mobile phone or WLAN router is active right next to it, with maybe 0.5 to 1 W RF emission.
At GHz frequencies the 22 Ohm resistor already helps, if it sits near the interface resp. near the circuit board rim.

Regards, Dieter
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: ro
Re: 22 ohm current limiting resistors for stm32 programming
« Reply #9 on: November 06, 2021, 02:54:53 pm »
Do I have to include these 22 ohm resistors

Yes.  They are against ringing and reflections (in the sense of signal reflections in a wire acting like a transmission line).  They are not for current limiting.  Put them near the pins of the source signal.

If you don't include the resistors, programming might work unreliable, or not at all.  As an example, I've seen a case where the same programing cable sometimes was working great and some other times was unusable only because the clock was the nearby or the faraway wire relative to the GND wire in a flat cable.

If you feel lucky you can remove the resistors, but if you want a reliable communication you must have the dumping resistors.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf