nRF51-DK as Debugger/Programmer
The nRF51 DK board supports programming and debugging of external boards. The idea is to use the built-in JTAG adapter for external programming of the Metawear. Of course, this feature can be generally used with other ARM chips supported by JLink. To debug an external board, use the Debug out (P19 or P20).
The external board
|Flat Ribbon Cable .050″||ME10G-5-ND||2.64|
|Socket .050″ 10POS||M50-3300542||2.01|
|Socket .050″ 4POS||3M15519-ND||3.59|
|Click for Cart-Share (Digikey EU)|
Well, one can rightfully argue that 8.8€ is not a cheap solution, but at the time I was experimenting with this, I could only find these kind of connectors. I would more than happy if someone can point out a more affordable solution.
Synthesizing the Cable
To figure out how to correctly create the cable see the figure below:
Is obvious that we are only interested in 4 pins from the Debug-out port
However the EXT_GND_DETECT is also important as it is used by the Jlink chip to detect if an external board is connected. More specifically, the EXT_VTG is low and EXT_GND_DETECT is high by default when nothing is connected to P20 and that is how JLink chip senses the presence of the external board. The below figure shows how to map the pins to the cable/connectors.