Monday, May 30, 2022

ArrowBlaster Internals


 ArrowBlaster (TEI0004) and ArrowBlaster SMD (TEI0005) are both based on FT2232H USB FIFO chip. There are no custom OS drivers involved, the standard FTDI drivers are used for both. What is downloadable from Trenz Electronic website as "driver" is actually a DLL/SO dynamic library for Windows/Linux for Quartus to recognize the programmer hardware. This DLL uses channel A (ADBUS0..3) in MPSSE mode to access the standard mapping JTAG pins connected to it. ADBUS7 is connected to RED LED (active low) and it is used as a busy indicator by the Arrow software DLL.

Quartus <> Arrow "driver" DLL <> D2XX library DLL <> FTDI USB drivers

ADBUS4 (named PROC_RST on TEI0004) is described in the documentation as "for future use" but it is highly unlikely that the Quartus DLL will ever utilize this pin. So it is free for use by the end-user applications. So at any time when the Quartus is not accessing JTAG ADBUS4 can be controlled by the user application over D2XX DLL/SO. One example of usage would be control of the JTAG Enable signal - some FPGAs (like MAX10) can use the dedicated JTAG pins in User Mode. During programming and debugging the JTAG would be enabled, and then in user mode, the end-user application would access ADBUS0..3 via D2XX say like an SPI port between the user application and the FPGA code. FTDI provides lots of examples of D2XX library use.

Arrow driver does not access channel B at all, so it is free for the end-user at all times. Channel B is free for end-user to be used as an extra UART channel to the FPGA. On TEI0005 there is one more pin BCBUS0 available to the end-user. This could be controlled over D2XX DLL easily. It is also possible to control the UART function over D2XX so in this case, the end-user could use port B UART and one GPIO pin at the same time. Another use case could be channel B as UART via VCP drivers, and channel B ADBUS4 as GPIO over D2XX at the same time (Quartus not active).

Third-party software that supports FT2232H can also use these adapters. One example application is SVF player.

FT2232H EEPROM is programmed with "Quartus License" information, if you erase or over-write it, then Quartus would no longer recognize the dongle. It is possible to convert the adapters to Microsemi programmer (TEI0004 VREF pin would not map to Microsemi pinout so custom wiring is needed in that case).

Some use cases:

Case 0:

  • Channel A - Quartus or 3rd party FT2232 JTAG software active
  • Channel B VCP UART
  • ADBUS4 not usable
  • BCBUS0 not usable

Case 1: 

  • Channel A - No JTAG software active, or custom D2XX software
  • Channel B VCP UART
  • ADBUS4 D2XX custom software GPIO1
  • BCBUS0 not usable

Case 2: 

  • Channel A - No JTAG software active, or custom D2XX software
  • Channel B D2XX UART
  • ADBUS4 D2XX custom software GPIO1
  • BCBUS0 D2XX custom software GPIO 2

2 comments:

  1. Hi Antti,

    thanks for the very helpful blog post.
    I still have some questions about this topic:

    My idea of an application is the following:
    I want to use Channel A as JTAG, no changes.
    I want to use Channel B as VCP UART (no special D2XX UART driver).
    On the application, I have 2 FPGAs, each has an UART.
    My idea is to use one of the FT2232H's GPIO to enable/disable an external electronic switch, which switches the VCP UART to either the first or the second FPGA's UART.

    As far as I understand, this could be possible by writing a custom D2XX executable. I could use ADBUS4 from channel A as a GPIO.
    1) Before launching my custom D2XX executable or starting Quartus programmer, do I have to manually change the driver every time when switching between JTAG and D2XX ?
    Or does the default driver come back automatically after my custom D2XX executable is finished?
    2) When the D2XX is not used, and the Trenz Module is used as a JTAG Programmer (with Quartus), what is the default state of the ADBUS4 pin?

    ReplyDelete
  2. 1) no need change anything, if quartus programmer is not active you can access over d2xyx any time.
    2) should be driven to logic high, as the ADBUS4 is input with weak pull-up.

    ReplyDelete