Lattice did it right by not making things difficult for customers who desire to program their PLDs or FPGAs with a custom JTAG programming adapter (perhaps even designed onto the customer board). Although the Lattice cable is relatively low cost, there is an even lower cost option available: FTDI FT2232H Mini Module. This tiny module is available for approximately $20 from distributors like Digi-Key and Mouser, and it can be used directly as a programming adapter for Lattice devices (and others) by following the setup described below.
JTAG is a 4-wire protocol defined by the IEEE (Std 1149.1-2013). The signals that comprise the Test Access Port (TAP) are TCK, TMS, TDI, and TDO. Various implementations also make use of additional pins for test and programming (i.e., TRST). Support of these additional signals can be accomplished with the FT2232 device through general purpose I/Os; however, our implementation only makes use of the 4 core signals and ground.
A disclaimer it warranted here: use these instructions and the mini module with care and at your own risk. We have been using this module for programming various devices for a long time. However, there are associated risks, such as having the un-enclosed mini module short against something, wiring it improperly, using a faulty card, etc. However, if you exercise caution, review the mini module & device data sheets, and double check your connections, you should be fine.
Note it is our understanding that the mini module will only work with 3.3V targets. Although there are VIO pins on the mini module connector, these pins do not support a voltage other than 3.3V.
|MM Pin #||MM Pin Name||Target Pin #||Target Pin Name|
- Target board is a Freescale TWR-LS1021A, and its JTAG connector is at J10 (6-pin header).
- Power (3.3V) is not connected between the target board and mini module (MM).
- Connections for MM follow USB-bus powered guidelines. The
following additional connections are also required:
- CN3-1 is connected to CN3-3, which connects USB power to FTDI voltage regulator input.
- CN2-1 is connected to CN2-11, which ties V3V3 to VIO on FTDI device.
- The FT2232H is a two port bridge device and either port can be used for JTAG. Our configuration makes use of bus / port A. This follows other examples, such as the Lattice ECP5 Versa board design, which directly connects a FT2232H device to its FPGA.
Lab Bench Image
Shown below is a picture of a mini module connected to the target on our lab bench. The target is a Freescale TWR-LS1021A development board. The TWR development board utilizes a Lattice CPLD and provides a 6-pin in-line programming header.
Lattice Programming Software Configuration
If everything is connected properly, then the programmer should work without any issues on Windows machines. Of course, you'll have to let the machine detect and load the appropriate USB and FTDI drivers. Once this is done, perform a detect cable, and you should see something similar to what is depicted in the figure below.