Quick Bits Resources

In Circuit Programming Connectors

Written by Andrew Levido

Over the years I have used a number of different approaches for the in-circuit programming (ICP) of the microcontrollers in the projects I have designed. None have been perfect, but I wanted to discuss the relative pros and cons of the various solutions.

The ICP connector will be used more or less continually while the project is in the prototype state, but (hopefully) only once in the production stage. The connection needs to be robust and reliable, have a small footprint and ideally be very cheap. Typically, we need four or five pins for protocols such as Arm Cortex Single-Wire Debug (SWD) or Microchip’s In-Circuit Serial Programming (ICSP). If we want to use full JTAG, or an advanced instruction trace we typically need up to 10 pins.

FIGURE 1. The J-Link Debugger is a very popular solution for programming and debugging Arm Cortex microprocessors. It has a 20-pin 2.54mm pitch header for connection to the target. You can use the pictured IDC cable to connect to your board, but the programming connector will take up a lot of space.

The most obvious solution is a 2.54mm header that is compatible with your favourite programmer/debugger. For example, I use a Segger J-Link (Figure 1) or ST-Link V2 (Figure 2) for Arm Cortex development and these have a 20-pin double-row header. You could put a similar connector on your project and just use a 20-way IDC ribbon cable. This is low(ish) in cost but takes up a large amount of precious PCB real estate, especially if you only need 5 pins for SWD. The connector measures about 31mm x 9mm and so takes up 279mm2 of PCB real estate.

FIGURE 2. The STMicroelectronics J-Link V2 also has a 20-pin 2.5mm pitch header. The smaller connector is for programming 8-bit parts.

One alternative is to use a 5-way single-row 2.54mm unshrouded header and make up a suitable cable. This works fine, is low in cost and reasonably robust. It measures about 16mm by 3mm and so has a footprint of 48mm2.  It is not keyed, so it’s possible to insert it backwards or “off by one”.  The 2.54mm header solutions are all relatively tall – about 16mm including the IDC connector.

Another popular solution is the “Plug-of-Nails” from Tag Connect. The plug consists of six or ten pogo pins which contact small pads on the target PCB (Figure 3). One version has plastic “claws” which clip into non-plated holes to hold the connector in place. Cables are available ready-made for a multitude of programmers. The board footprint is small (about 10mm x 7mm or 70mm2 for a 10-pin version).

FIGURE 3. The Tag Connect “Plug-of-Nails” has an array of pogo-pins that make contact with exposed pads on the printed circuit board. The three steel pins locate the pins and a small clip can be used on the rear of the board to hold them in place. Another version has plastic clips that latch into additional holes in the board, but this takes up a bit more space.

The downside for the Tag Connect solutions is the price of the cables. These are not cheap especially if you use a few different debuggers and, like me, always want to have a spare on hand. Obviously the per board cost is zero since there is no target connector – great for production. I also find the height of this connector to be a problem in some circumstances.

FIGURE 4. The 10-pin 1.27mm pitch header is shown at the top left. This takes up only 36 square millimeters and is keyed so the cable can’t be inserted incorrectly. Off the shelf pre-terminated ribbon cables are readily available to mate with this connector.

Most recently I have been using an off the shelf 10-pin double-row 1.27mm connectors for my projects (Figure 4). These have the advantage of being small (6.3mm x 5.8mm or about 36mm2), low profile at 5mm in height, relatively cheap and available from a number of sources. They are keyed, so it’s impossible to connect wrongly. I am not the only one to use this connector for programming, so it has de-facto standard pin-out and an adaptor board is available from Adafruit to connect it to the J-Link. I use pre-terminated IDC cables and a small home-made adaptor board for my J-Link (Figure 5).

FIGURE 5. My programming set-up. An adapter bard converts between the 20 pin J-Link connector and 10-pin connector. An off the shelf ribbon cable then provides the connection to the target. Note the low-profile connector fits neatly under the display board.


“J-Link Debug Probes.” Accessed June 15, 2021. https://www.segger.com/products/debug-probes/j-link/.

“ST-LINK/V2 – ST-LINK/V2 in-Circuit Debugger/Programmer for STM8 and STM32 – STMicroelectronics.” Accessed June 15, 2021. https://www.st.com/en/development-tools/st-link-v2.html.

Tag-Connect. “Tag-Connect.” Accessed June 15, 2021. https://www.tag-connect.com/.

Industries, Adafruit. “Mini SWD 0.05″ Pitch Connector – 10 Pin SMT Box Header.” Accessed June 15, 2021. https://www.adafruit.com/product/4048.

Industries, Adafruit. “JTAG (2×10 2.54mm) to SWD (2×5 1.27mm) Cable Adapter Board.” Accessed June 15, 2021. https://www.adafruit.com/product/2094

Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.

Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article
+ posts

Andrew Levido (andrew.levido@gmail.com) earned a bachelor’s degree in Electrical Engineering in Sydney, Australia, in 1986. He worked for several years in R&D for power electronics and telecommunication companies before moving into management roles. Andrew has maintained a hands-on interest in electronics, particularly embedded systems, power electronics, and control theory in his free time. Over the years he has written a number of articles for various electronics publications and occasionally provides consulting services as time allows.

Supporting Companies

Upcoming Events

Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2024 KCK Media Corp.

In Circuit Programming Connectors

by Andrew Levido time to read: 3 min