Lab-Tools.com

Scientific Instrumentation and Software
for Industry and Academia

lab-tools.com/instrumentation


FPGA_PC

Interfacing a circuit in an FPGA to a PC

a new firmware interface for USB interfaced instrumentation.

This page demonstrates a fast way of getting PC access to firmware circuitry in a Field Programmable Gate Array (FPGA).

Pre-written VHDL firmware and array-based software, facilitate interfacing a PC to the FPGA over the USB, and gives transparent access to multiple banks of sub-modules and instrument functions in the FPGA at full USB2 rates of 480 Mbit/s (60MBytes/s).

Each sub-module has an independent block of up to 256 USB interface registers, to configure the sub-instrument and for bi-directional data transfer. This code forms the skeleton into which the sub-modules / instruments may be slotted, in a consistent manner.

There are a number of approaches to interfacing computers to the real world - my preferred one has changed every decade since the 1970s.

My current preferred approach for interfacing computers to the real world is to use the USB bus and to interface this to field programmable gate arrays (FPGAs). For this I now use FTDI's FT2232H USB2 interface chip (i.e. as on their Morph-IC-II FPGA module), plus a VHDL modular firmware skeleton that I have spent the last few years creating - this is now up and working at the full USB2 rate of 480 MBit/s (60 MByte/s). This is designed to provide the default skeleton into which one or more VHDL instruments can be dropped, and then allows them to be controlled over the USB bus. USB interface registers allow these devices to exchange data with the PC, and other registers to act as Control & Status Registers (CSRs). There is also a full USB2 speed bi-directional data pipe that can be connected to any instrument module as needed.

Freely downloadable binary code is available below for the GUI and for an Altera Cyclone II, as for example on an FTDI USB2 interfaced Morph-IC-II FPGA module, but other FPGA modules may also be interfaced. Source code is also available.

www.lab-tools.com - Interface a circuit in an FPGA to a PC
Three example circuits in an FPGA, interfaced to a PC, using a GUI.



Video putting the above GUI and the three example circuits in the FPGA through their paces.

www.lab-tools.com - FPGA Modular Firmware Skeleton for multiple instruments.

Lab-Tools FPGA Modular Firmware Skeleton for multiple instruments,
with three simple demonstration instruments.
www.lab-tools.com - Interface to a 16 bit counter in the FPGA.

Example Instrument 0 : Interface a PC to a 16 bit counter in the FPGA.


Example Instrument 1 : Lab-Tools Morphic-II Fast Data Transfer to Altera Cyclone II.

This video demonstrates a scripting approach to fast block transfer of vectors of data to and from Lab-Tools modular instrumentation over the USB2 interface, at full 480 MBit/s (60 MByte/s) rate, using the Morphic II module containing an Altera Cyclone II Field Programmable Gate Array (FPGA).

www.lab-tools.com - FPGA Modular Firmware Skeleton fast block transfer of vectors of data.
Instrument 1 : FPGA Modular Firmware Skeleton fast block transfer of vectors of data.

The FPGA_interface_to_PC GUI allows easy testing of transfering vectors of data between the PC and FPGA memory, at full USB2 speeds of 480 MBits/s (60 MBytes/s) peak, providing actual timings for different vector lengths in your own system.


Example Instrument 2 : Lab-Tools FPGA Binning Co-processor for Apl.

This video demonstrates a scripting approach to fast block transfer of vectors of data, using a USB2 interfaced FPGA co-processor for use with the array processing language Apl. This co-processor implements a single scientific algorithm : Binning. This provides an example of what can be achieved using field-programmable gate array co-processors with Apl.

www.lab-tools.com - FPGA Modular Firmware Binning algorithm GUI.
Instrument 2 : FPGA Modular Firmware Binning algorithm controlled from a GUI.

The FPGA_interface_to_PC GUI allows easy testing of transfers of long data vectors between the PC and precesses running in the FPGA, providing timings for different vector lengths in your own system. These vectors can be larger than a single default 64k Byte USB data transfer, but run seamlessly.


FPGA Module

The FPGA module used for these tests is the Morph-IC-II, available from both FTDI and from Lab-Tools. This module contains an Altera Cyclone II FPGA, and has the advantage that it does not require a USB Blaster to program it - it performs high-speed programming and data transfer through a single USB connection. The B side is used to program the FPGA and the A side is for data transfers. A USB2 interface mini-module is also available that can be used to interface to other FPGA modules. These devices allow for full USB2 speed data transfers over the USB Bus.

The FPGA is accessed and controlled using AplX, a version of the array processing language Apl, from Micro-Apl. It has also been used to generate the GUI. However any language that can interface with the .dlls can be used.

www.lab-tools.com - Interface to a 16 bit counter in the FPGA.

FPGA_PC Licensing Versions:

This sofware and firmware is available under five licensing versions :

  • TF:
    Licence : Transmit Freely.
    VHDL: Binary, (Altera .rbf file);
    Apl (Script): Binary;
    Apl (GUI): Binary.
Free Download - 2.5MByte, Version 0.95.
Note you will first need to download and install the APLX Support Library from MicroApl .
If you run Norton: their Insight/Sonar programs were complaining. Now : "The Symantec Insight Dispute team has reviewed
your recent submission to the Insight Dispute Submission form Webpage form "FPGA_interface_demo_2012-05-13_TF."
In light of further investigation and analysis Symantec is happy to remove this detection from within its products."
  • PNS:
    This is released with paid licence :
    Licence : Personal, no sharing.
    VHDL: Source (Altera archive);
    Apl (Script): Source;
    Apl (GUI): Binary, (optional Source).
£ 30 : Send email to Dr. Beau Webber
asserting that the package will only be used for personal use,
and will not be passed on to others.
  • AND:
    This is released with paid licence :
    Licence : Academic, No duplication.
    VHDL: Source
    Apl (Script): Source,
    Apl (GUI): Binary, (optional Source).
£ 100.
  • CND:
    This is released with paid licence :
    Licence : Commercial, No duplication.
    VHDL: Source
    Apl (Script): Source,
    Apl (GUI): Binary, (optional Source).
£ 250.
  • CLD:
    This is released with paid licence :
    Licence : Commercial, Licensed duplication.
    VHDL: Source
    Apl (Script): Source,
    Apl (GUI): Binary, (optional Source).
Price for discussion. Send email to Dr. Beau Webber
Enter Order Details


Software, firmware and hardware modules are also available from Lab-Tools Ltd, who are also developing a series of credit-card sized interface and data I/O modules to interface with them, using this interface approach :
www.lab-tools.com - instrumentation - Precision DVM

Lab-Tools Instrumentation - Precision DVM.
www.lab-tools.com  - instrumentation - Transient Averager.

Lab-Tools Instrumentation - Transient Caprure / Average / Process.

The prototypes of these modules have been running in the Lab-Tools NMR lab 24/24 7/7 for over a year, and such modules will soon be available for purchase.



2000 ... 2012