How to select channel B on FT2232?

Some time ago I built a [JTAG opendous FT2232. It’s similar to JTAGKey, but uses channel B of the FT2232 instead of channel A. Documentation of this JTAG adapter is old and incomplete. It suggests to change the channel in the source code of version 0.4.0 and recompile, and states that “The next release of OpenOCD will feature the ability to change this setting more easily”.

I have been browsing OpenOCD documentation, and also googling for a while, and I couldn’t find how to change channel settings. Was this feature finally implemented in version 0.5.0? Browsing file ftdi2232.c, it looks like, because interface is set in function ft2232_init, from variable layout->channel. The problem is to use this layout, JTAG interface layout must be defined, and the only two interfaces using channel B I can see in the sources are redbee-usb and lisa-l. Will it work if I select redbee-usb or lisa-l? Do I need to add a new interface? Would something like this work?:

	{ .name = "opendous-ft2232",
		.init = jtagkey_init,
		.reset = jtagkey_reset,
		.channel = INTERFACE_B
	},

](Google Code Archive - Long-term storage for Google Code Project Hosting.)

A similar process exists for OpenOCD 0.5.0. Changing [line 2216 of ft2232.c to INTERFACE_B will allow the use of the board as a JTAGKey.

If you cannot or don’t want to recompile OpenOCD and your target board’s JTAG voltage is 3.3V you can connect directly from the Channel_A breakout header to your target. The [FT2232H Datasheet lists the connections on Pg.8: D0=TCK, D1=TDI, D2=TDO, D3=TMS, GND=GND. In this case the Output Enable pins aren’t required unless you must be able to disconnect JTAG completely via software. You would then need to add a buffer IC with an nOE pin.

If you need to translate to a lower voltage target, the [SN74LVC245AN buffer IC comes in DIP and can tolerate inputs up to 5.5V even when running at 1.8V.

If you need to translate to a higher voltage target, the [SN74HC245N buffer IC comes in DIP and its Input High Voltage (Vih) is 3.2V when operating at 5V.

If using a buffer, power it using the target’s voltage. Refer to Vref in [this schematic. OpenOCD does not use Vref sense so there is no need to connect Vref to the FT2232H. Note that channels A and B on the FT2232H are equivalent with respect to JTAG.](http://opendous.googlecode.com/svn/trunk/Current_Designs/Opendous_FT2232H_JTAG/Opendous_FT2232H_JTAG_Schematic.pdf)](http://www.ti.com/product/sn74hc245)](http://www.ti.com/product/sn74lvc245a)](http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf)](OpenOCD - Open On-Chip Debugger / Git tools)

Thanks a lot. I’ll try to change the suggested line and recompile.

Unfortunately I’m new to ARM, and I don’t have too much spare time to play with this :frowning: