To recap, my goal for this project is to build a (somewhat) general purpose data acquisition device, capable of digitising two analog inputs and streaming the resulting samples to a PC over USB.
I previously made an ADC breakout board to serve as the front-end. This post describes extending that with the ability to stream samples over USB, yielding a working prototype. (Albeit only capable of streaming a single channel at present.)
The basic idea is to combine the ADC breakout with a FT232H USB bridge and a Lattice iCE40 FPGA. The FT232H makes it easy to talk USB, while the FPGA interfaces between the USB bridge and the ADC.
Here's a picture of the set-up:

The ADC I'm using has a resolution of 10 bits and I'm running it at 8 MHz. If I use two bytes per sample, then for two channels, I'll need to push 32 MB/s over USB. To achieve this with the FT232H it must be configured in synchronous FIFO mode. In this mode, the FT232H generates its own 60 MHz clock to pace data transfers.
Since the FPGA sits between the USB bridge with its 60 MHz clock, and the ADC, which is driven by its own 8 MHz clock, it has to handle cross domain clocking. The standard way to achieve this is with an asynchronous FIFO, and for that I'm using this library. The FPGA also includes a little bit of logic to serialize the 10 bit samples as two bytes, but not much else besides.
On the PC side, I'm using libFTDI to talk to the FT232H. I've written a very simple program to forward data from the device to stdout. The output from this can then be redirected to a file, or piped to another program for processing, visualisation, etc. The implementation is more-or-less just a thin wrapper around ftdi_readstream.
Here's a plot showing data captured using this set-up. In this example the input was driven by my LiteVNA in CW mode at 500 kHz.

Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.