Improved parallel-port wiggler-style JTAG adapter
OpenOCD, the Open On-Chip Debugger, is a nice open-source JTAG debugger that supports flash programming and (with gdb) debugging on a wide range of ARM CPUs by utilizing the core’s remote debug capabilities via the JTAG port. To use OpenOCD, you need some kind of JTAG adapter. There are multiple affordable JTAG adapters, most of which are USB-based. Since I had some reservations about the required USB libraries, I wanted a JTAG adapter that works on the parallel port, because the software has direct access to the port without any closed libraries. Because the schematic in Dominic Rath’s diploma thesis was a bit outdated, I decided to roll my own – after all, there is not much magic in such an adapter.
The design goals were:
- Must work with ARM targets running on 3.3V, with correct level translation
- Must make sure that a powered-off target does not pull power via the parallel port’s data lines.
- Should have LEDs that indicate target power and data transmission.
- Should fit into a standard DB25 adapter housing, with DB25 (parallel port) connector and 20-pin JTAG header mounted on the PCB edges
- Should be easy to build. The first version was built on perfboard, the final version is a double-sided PCB with very few vias, where the bottom layer can be replaced by some wires (see photos).
The adapter can be used with the “wiggler” driver that has been in OpenOCD for a long time. Newer OpenOCD versions support the “wiggler2” driver that drives the activity LED on this adapter.
The important part is the 74LCX245. This octal bus buffer has the feature that it can handle 5V on the inputs even when VCC is at 3.3V or 0V. 74LVX245 from some manufacturers may work as a substitute, but be sure to check the datasheet for the exact part you want to use!
When you only need to connect 5V ARM targets, a 74HC245 might work, but in case of 3.3V targets, the input diodes of the 74HC245 will provide a path from a high-level parallel port line to the target VCC, possibly destroying the 74HC245 or the parallel port – you have been warned.
Note that the same path via the input protection diodes causes problems when the target is powered off, while some parallel port lines are high, so make sure to power up the target before starting OpenOCD, and cleanly exit OpenOCD before powering off the target. The wiggler2 driver in OpenOCD makes sure that all parallel port lines are low when cleanly exiting OpenOCD.
The Adapter was used on multiple IXP420-based boards and on a Net+ARM ARM7 board. Performance when programming a 16-bit AM29LV320 flash is quite good: using the parallel port adapter, programming speed is around ~14KiB/s (compared to ~20KiB/s using an Olimex USB-adapter).