connections
Figure 4. Schematic of the JTAG programmer/debug adapter.
Board power
Powering a target from its programmer is very handy, although some devices do not like that and need to power themselves.
Many of those Internet of Things devices like sensors and beacons run from a 3-V coin cell and/or are USB powered, even though they might not have USB data access. That means they are sitting there with a USB connector already built in which is something to keep in mind. Hav-ing the options of 5 V, 3.3 V, or “none” is very useful, and it is exponentially useful if you can easily change between them with your connecting system.
Other signals
Probably every embedded system has a basic UART-based debug port. Having access to that in development is essen-tial, and often it is the gateway used in production to load device configurations or send self-test results. Optimizing a production process for ease of use is extremely important — every extra step costs time and money and injects risk in the process. Accessing the processor reset line is helpful if it is not otherwise accessible and you may wish to bring out a few other IOs, too.
Making the choice
The JTGAD features three connector solu-tions that have emerged as favorites over many years of product development by the author:
• 0.050” pitch, 2x7 pin (J5). This rel-atively small part is surface mounted, multi-sourced, reasonably priced, and has enough signal lines for every scenario we have encountered. The target can be powered, and five extra lines are used that can support two UART pairs and an IO line intended for a system tick.
• Tag Connect TC2050-IDC (J7). If you have not come across Tag-Con-nect you are in for a treat [3]. It is described as a “plug of nails” and allows you to use the zero-cost-per-PCB pads method, but still provides a robust connection both for devel-opment and production (Figure 3).
connector on a board while it programs without breaking the connection during the process. Good connections to contact pads require a spring contact or spring-loaded “pogo pins”. If it only takes a few seconds to flash the processor, holding spring pins is not too bad. Trying to hold them while you debug code is not going to work and you will end up wasting time trying to rig up a fantastic elastic or duct tape concoction to keep it in place. Bot-tom line: if you use contact pads, make sure the header has spring contacts whether this be in a hand-held connec-tor, card edge-style connecconnec-tor, or on a bed-of-nails fixture.
Figure 1. Segger’s J-Link for ARM MCUs [1] and the MSP-FET [2] for the MSP430 crowd.
Source: Segger/Texas Instruments
Figure 2. The pinouts of the programming connectors for ARM and MSP processors.
Figure 3. A Tag Connect TC2050-IDC uses a number of PCB pads to make the connections for programming. Source: Tag-Connect LLC
IP4220CZ6,125
5V USB15V USB2
2
UART FTTX2' UART FTTX2
UART FTTX1
Table 3. JTGAD LED Indicators
Designator Board Mark Color Meaning
D1 JPWR BLUE JTAG power
D2 TRGPWR GREEN TARGET power
D3 TICK RED Tick / Heartbeat
D5 TX GREEN USB1 TX
D6 RX YELLOW USB1 RX
D7 USB PWR BLUE USB1 power
D9 TX GREEN USB2 TX
D10 RX YELLOW USB2 RX
D11 USB PWR BLUE USB2 power
recommended, for developers it is a great option. With so many devices using a USB micro B connector for power only, the temptation to tie into the unused D+ and D– and use them for ARM devices support-ing two–line SWD programmsupport-ing is impossible to resist.
The circuit
Figure 4 shows the schematic of the JTGAD. The main part of the schematic consists of several connectors, a voltage regulator and a number of pinheaders for choosing the desired settings. All jumper settings are shown in Table 1.
The board takes 5 V from the JTAG or USB connector and has an on-board LDO (U1) to make a 3.3-V rail available. Jumper J9 selects the 5V source to use and J10 chooses 5 V, 3.3 V or none (no jumper) to the target. Leave both pinheaders open for no supplied target power.
The repurposed USB connector J4 can carry only two signals since there are no more physical lines available. In fact, the connection is one line short of what is typically required since programmers need to sense the target voltage to pro-gram. The JTGAD takes care of this with the SNS jumper on J3. This routes the 3.3-V source back to the programmer to emulate this signal. J12 allows the SWD and there is space for a UART pair.
• Repurposed USB (J4). Though repurposing standard connectors is a bit confusing for end users and not The cables clip into a PCB footprint to
effectively give a zero-cost connection into production devices. On the 10-pin version, full JTAG signals are present
Table 2. JTGAD USB to serial connections Connector Board
Reference
Tx Driver
Jumper Target Board Connections
J1 USB1 TX1_EN
J5 Pin 4 (Tx board to Rx target) J5 Pin 6 (Rx board from Tx target) J7 Pin 7 (Tx board to Rx target) J7 Pin 9 (Rx board from Tx target)
J2 USB2 TX2_EN J5 Pin 12 (Tx board to Rx target) J5 Pin 14 (Rx board from Tx target) Table 1. JTGAD Jumpers
Jumper Position 1 Position 2 Off Function
VPP (J9) Position ‘JTG’: voltage VPPJTAG from J6 or J8 to VPP
Position ‘USB’: highest USB voltage from J1 or J2 (5 V USB less diode drop) to VPP
No power to VPP
TRGPWR (J10)
Position ‘VPP’: VPP provided to target
Position ‘3.3 V’: regulated 3.3 V
provided to target No power to target board.
SNS (J3) 3.3 V to JTAG VSNS N/A 3.3 V not on VSNS (target Vcc to VSNS)
RST (J3) Target reset line pulled up; reset
button active N/A Target reset line not terminated
TX1_EN (J11)
USB1 Tx driver and pull-up
attached to target N/A UTX1 to target floating
TX2_EN (J11)
USB2 Tx driver and pull-up
attached to target N/A UTX2 to target floating
CLK (J12) CLK-P2: SWDCLK connected to pin 2 of repurposed USB (J4)
CLK-P3: SWDCLK connected to pin
3 of repurposed USB (J4) Not valid if J4 is used
IO (J12) IO-P3: SWDIO connected to pin 3 of repurposed USB (J4)
IO-P2: SWDIO connected to pin 2
of repurposed USB (J4) Not valid if J4 is used
Web Links
[1] www.segger.com/jlink-debug-probes.
html
[2] www.ti.com/tool/MSP-FET [3] www.tag-connect.com
[4] www.elektormagazine.com/150511 [5] www.elektor.com
data and clock lines to be set to either D+ or D- depending on how the target is configured.
Both J5 and J7 connectors also allow easy access to the target reset line with the onboard reset button S1. The RST loca-tion on J3 can disconnect both the built-in pull-up and the button from the target.
J5 also brings another line that we typi-cally use for the system tick / heartbeat.
Your target could repurpose this for any logical output desired.
There are two on-board serial-to-USB driv-ers (U2 and U3), so you can attach directly to your PC terminal without needing exter-nal USB to Serial ports. Both UART pairs can be accessed through J5 and one pair through J7. The transmit drivers on each UART can be disconnected with J11, so the target lines are not loaded. More informa-tion can be found in Table 2 and in the JTGAD datasheet available from the Elek-tor Magazine website [4].
JTGAD also lights up beautifully to pro-vide a multitude of quick visual indica-tors about what is happening. Table 3 summarizes all of the LEDs on JTGAD.
Blue LEDs D1, D7, and D11 quickly show which 5V sources have power and D2 is a green indicator to remind you if the tar-get is powered. Both UARTS have yellow and green LED indicators to show receive and transmit activity. A red LED presents quick indication of the system tick.
PCB
The double-sided circuit board shown in Figure 5 offers space for all components on only 44 x 46 mm2. As most of the components are SMD versions is will not be so easy to solder for less experienced readers. Therefore the board is available through the Elektor Store, fully assembled and tested [5]. You can use it right away!
Of course the PCB layout of the board is available for free [4] if you have the equipment, experience and wherewithal to build your own board.
Conclusion
The combination of connector choices and the array of great options on the adapter board provide designers with a lot of options for development. We are excited to share with the community and hope it helps you out. Enjoy!
(150511)
Component List
Resistors
All SMD0603, 1%, 0.1W R1,R3 = 1.2kΩ 1%, 0.1W R2,R11,R12,R17,R18 = 390Ω R4,R6,R21,R22,R23,R24 = 100kΩ R5 = 698kΩ
R7,R8,R10,R16 = 10kΩ R13,R14,R19,R20 = 33Ω R9,R15 = 0Ω
Capacitors
C1,C2 = 1µF 16V, X5R, ceramic, SMD 0603 C3,C9 = 33nF 25V, X7R, SMD 0603 C4,C6,C10,C12 = 100nF, 25V, X5R, SMD C5,C11 = 10µF, 10V, X5R, ceramic, SMD 0603 C7,C8,C13,C14 = 47pF, 50V, C0G, SMD 06030805
Semiconductors
D1,D7,D11 = LED, blue, SMD 0603 D2,D5,D9 = LED, green, SMD 0603 D3 = LED, red, SMD 0603 D4,D8 = 1N5819HW-7-F, SOD-123
D6,D10 = LED, yellow, SMD 0603
U1 = MCP1824T-ADJE/OT, SOT-23 (Microchip) U2,U3 = FT230XS-R, SSOP-16
U4 = IP4220CZ6,125, TSOP-6 Miscellaneous
J1,J2 = micro-USB 2.0 type-AB R/A PCB con-nector, SMD with legs
J3,J11,J12 = 4-pin (2x2) pinheader, 0.1”
pitch
J4 = USB 2.0 type-A R/A PCB connector J5 = 14-way (7x2) female terminal connector,
SMD, 0.05” pitch
J6 = 20-pin (10x2) boxheader, 0.1” pitch J7 = 10-pin (5x2) pinheader, 0.1” pitch J8 = 14-pin (7x2) pinheader, 0.1” pitch J9,J10 = 3-pin pinheader, 0.1” pitch 8 jumpers, 0.1” pitch
S1 = 6mm tactile switch SPST-NO, SMD Ready-assembled board # 150511-91
avail-able from Elektor Store Figure 5. Component layout of the JTGAD board. The board is available ready manufactured from the Elektor Store.