Programming an external board

nRF52840 DK Hardware

For boards with a standard 10-pin Serial Wire Debug (SWD) connector or a connector that supports a standard 10-pin flat cable, it is recommended to connect to P19.

Connect the boards as shown in the following figure.

Figure 1. Connecting an external board to P19
Connecting a custom board to P19

It is recommended to power the external board separately from the DK. The voltage on the external board must match that of the DK. When the DK is powered through the USB connector, the voltage is 3 V.

When pin 3 (SWD0_SELECT) of P19 is connected to GND through the 10-pin flat cable, the interface MCU programs or debugs the target chip on the external board instead of the onboard nRF52840 System on Chip (SoC).

The following figure shows the pinout of the P19 connector.

Figure 2. Debug output connector P19
Debug output connectors P19 nRF52840 DK

The following table describes the pinout of the P19 connector.

Table 1. Connector P19 pinout for programming external targets
Pin number Signal Description
1 SWD0_VTG Optional voltage supply to the external target
2 SWD0_SWDIO SWD Input/Output line
3 SWD0_SELECT Debug out select signal, connect to ground on external board
4 SWD0_SWDCLK SWD clock line
5 GND Ground
6 SWD0_SWO The Serial Wire Output (SWO) line is not used for programming and debugging over SWD
7 N.C. Not used
8 N.C. Not used
9 N.C. Not used
10 SWD0_RESET Reset line

Supply power to an external board through P19

If you do not have a separate power supply on the external board connected to the Debug out connector P19, it can be powered from the onboard DK regulator or from an external source connected to the VIO_REF pin on P20.

Power the external board from the onboard DK regulator as follows.

  1. Ensure that SB19 is not shorted.
  2. To enable power output on P19, short solder bridge SB47.
  3. Power the DK through the USB connector.
CAUTION:
To avoid damaging your board, do not connect a separate power supply to the external board when SB47 is shorted and follow the instructions carefully.
CAUTION:
To avoid overloading the power supply and damaging the DK, use VDD and keep the supply below 100 mA. Do not use a Lithium-polymer (Li-Poly) source.

Alternatively, use VIO_REF on connector P20 to supply power to the external board as follows.

  1. Ensure SW10 is in the OFF position.
  2. Ensure SW9 is in the VDD position.
  3. Ensure that SB47 is not shorted.
  4. Short SB19.
  5. Power the DK through the USB connector.
  6. Ensure the voltage of the external power supply matches that of the DK, which is 3 V when using USB.
  7. Connect the external power supply to pin 12 (VIO_REF) on connector P20.