2
\$\begingroup\$

In most boards, the ICSP (in circuit serial programming) pins are of the male type. Is there any reason, guideline, standard or best practice that recommends this?

If not I would like to use female ports so that the power and ground cannot be accidentally shorted or the reset (active low) accidentally activated during repair or troubleshooting.

Most good quality programmers also have female ports for programming - I wonder why?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I'm guessing (but check for the pins you have in mind) male pins are marginally cheaper, and if you have a thousand boards and one programmer, that's a consideration. Many systems have NO pins (male or female) for ICSP, just pads on the PCB : a simple bed of nails fixture is attached to the programmer. \$\endgroup\$ – user16324 Feb 27 at 14:46
7
\$\begingroup\$

Male headers are generally less expensive and, with exposed pins, less likely to pick up internal contamination (for example during washing of the boards) without the necessity of seals that have to be removed etc., so they're generally the better choice. Most products are not designed to be exposed to troubleshooting or repair by unskilled people, and usually a short will cause no physical damage anyway (supplies are current limited and only logic voltages are on the connector). If you are sharing the connector with higher voltages, negative voltages or AC you may have other concerns.

Of course you can use pads and pogo pins or a Tag-connect cable, but a simple header allows anyone anywhere in the world to make up a suitable programming cable in a pinch. And they're cheap and reliable.

As far as programmers- many of them such as Segger, Lattice, Atmel SAM-ICE, STlink V3, PIC-KIT3 etc. have male pins in an shrouded header and an easily replaced F-F IDC ribbon cable is used between the programmer and the board. The only ones I notice that do not are Microchip ICD-2/4 which still use the original RJ11 female jack.

\$\endgroup\$
1
  • \$\begingroup\$ If you are sharing the connector with higher voltages, negative voltages or AC you may have other concerns. - ROFL. Thanks a lot for the answer. \$\endgroup\$ – Sujoy Bhattacharya Feb 28 at 15:50
2
\$\begingroup\$

For some connector types, (e.g. molex picoblade) male headers may be the only readily available choice.

More generally, there is a convention where if a connection has obvious "central" and "peripheral" ends, or "supplies power" and "receives power" ends, the former ones are female while the latter are male. So your logic makes some sense, but you would not want a programming header to be exposed anyway.

In low-but-not-trivial-quantity situation, I have arranged the programming header to also receive Vdd for the mcu, which avoids the contradiction (the devices are otherwise unpowered in the context of the factory setup), and more importantly streamlines the process - but this may be considered a bad practice - get a second opinion.

\$\endgroup\$
2
  • \$\begingroup\$ Why should the header not have the Vdd pin? I'd prefer my circuit to be off when being programmed. Is it so that the rest of the control circuit does not draw power from the programmer and end up in reducing the programmer voltage to dangerous levels? \$\endgroup\$ – Sujoy Bhattacharya Feb 28 at 15:52
  • \$\begingroup\$ @Sujoy Bhattacharya-- Yes that is a good reason. Another is that a general-purpose programmer with a range of Vdd wouldn't know the correct Vdd for other circuits in the system. So the Vdd pin in a general purpose tool may be used to sense Vdd rather than provide it. For a product-specific tool, I think one has more freedom to do whatever is convenient (e.g. have lines for both mcu supply and Vdd sense functions in one connector, add a "test-mode" trigger line, etc) \$\endgroup\$ – Pete W Feb 28 at 16:02
1
\$\begingroup\$

I prefer male pins on the board when possible as it reduces the total length of the connection. For your standard DuPont connectors, distance from board surface to wire is just over 22mm for a female header+connector housing. For male header pins, the assembly is only 16mm.

\$\endgroup\$

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.