JTAG Programming/Debugging Adapter

Published Mon, Jul 13 2009 0:08

Having a microcontroller in an embedded project doesn't do much good until you are able to program it, because in contrast to fixed-function ICs or configurable ICs with reasonable defaults, microcontrollers have little to no useful behavior from the factory. Some families of microcontroller, like the Z-World Rabbit or Microchip PIC, have unique programming circuits so your choice of programmer is essentially made for you -- you buy the adapter available from the IC vendor for several hundred dollars. Most ARM cores use the industry-standard JTAG serial port for programming, debugging, and (for other devices such as FPGAs) boundary scan test. That means a lot more options more adapters, but not necessarily much money saved. For example, For example, you can easily spend over $1000 on the Segger J-Link (pricelist in Euros) which is recommended by IAR who make the Embedded Workbench compiler/development environment. There's a free limited version of the software and the J-Link is available for non-commercial use at a more palatable price, but still quite expensive and development of a product is forbidden, so apparently the lower price isn't intended for open-source designers. Anyway, since I am developing a proprietary product, that isn't for me.

However, further digging around on the Internet produced first hope and then a budget-friendly solution. There's an open-source programming environment for JTAG named Open On-Chip Debugger, and some of the participants have put together designs for JTAG adapters along with lists of reasonably-priced commercial adapters. The DIY designs are mainly based on FTDI's USB/serial adapter ICs, which I've run into on previous projects and, interestingly enough, fought to eradicate from those designs. The reason was that the Windows drivers were buggy and caused occasional blue screens of death (ok, in some versions, which even passed WHQL certification, the BSOD came fast and frequent) which was totally unacceptable for the intended use. For programming, reliability isn't as important as the convenience, and while it's hard to prove absence of bugs, the latest drivers are improved and definitely not a hindrance, so I come to an opposite conclusion regarding using FTDI chips for JTAG.

I still probably would have chosen to go with one of the less expensive commercial models rather than FTDI though, because designing a board (with noise-sensitive USB traces!) isn't cost-effective by comparison, nor is placing a $6 chip on every board just to enable programming, but distributors sell not only the bare ICs but also ready-built modules which contain the USB connector, FTDI chip, EEPROM, crystal, all routed and assembled, for only $27 (Mouser gets the link because Digikey has none in stock at the time of this post). Including the connector for the mini-module is just as easy as the 2x10 connector used by the commercial adapters, the module can be moved around and reused between boards, this is the high-speed version, and to top it all off the second half of the FT2232H can be used as a UART to stream data to a PC in real-time. There's still a slight question about what magic incantation to program into the EEPROM so that the software recognizes it as a JTAG device, but I'm confident that can be overcome even if I have to read the OpenOCD source code.

I've now posted the schematic.

Leave a Comment

(required) 
(required) 
(optional)
(required)