Home‎ > ‎Articles‎ > ‎USB to Serial Converter Samples‎ > ‎

FT2232 to ADC0820 ADC Demo

    Today we'll be exploring how to connect the Universal USB to Serial Converter(or any FT2232 board) to two ADC0820 8 bit A/D Converters to make a simple yet useful and low cost two channel oscilloscope. We will be using the Asynchronous 245 FIFO mode on the FT2232 which is an 8 bit first in/first out buffer with a buffer full line and write line. In a nutshell, data is written on every write clock, and when the buffer is full the bufferfull line goes high. All the details can be read from the application notes at FTDIchip.com.
    The sample software and sourcecode can be downloaded here: FT2232 to ADC0820 Demo.zip. It was written in VB.NET using Visual Studio 2010 Express, which can be downloaded for free from Microsoft. The software/source code is yours to do with as you please, and if you use it, an acknowledgment is all I ask.

In order to use 245 FIFO mode, we have to program the onboard EEPROM. FTDI has a program called FT_PROG. Download and run the program and parse the FT2232 information.


As you can see from the image, after parsing the data, you need to navigate to the hardware settings under each port and select 245 FIFO mode. Once this is done, write the data to the FT2232 chip. I have noticed that the FTDI_Prog seems to have a bug where string descriptors do not get read back right if you change them. As far as I can tell they write properly, but do not read back correctly and appear as garbled characters.

   Now that the FT2232 chip is ready to receive 8 bit parallel data, we can now get to the circuit. Below is the schematic for our simple Scope.

    The schematic is super simple. First we have the FT2232 board, two ADC0820's, two TS555 timers, and a low pass filter. The only connections needed are the 8 data lines and the write line between the FT2232 and the ADC0820's. The first TS555 is used as the sample clock running at about 416Khz. (NOTE: if you do the 555 astable formula for the parts shown, you get  about 583Khz. But I only measured 416Khz. The datasheet for the TS555 specifies 2.7Mhz max, so I'm scratching my head at that one still.)
    The second TS555 is just a 2800Hz signal used for a sample signal into ChannelA. And finally, the 220 ohm and 1uF cap together make a low pass filter for ChannelB.
    This circuit does not monitor the state of the buffer full lines (AC1/BC1), and simply feeds data into the FT2232 on every clock pulse.

Warning! There is no protection on the Vin lines of the A/D converters. As such, insure that you do not go above the maximum input voltage on the data sheet (Vcc + 0.1) 5.1V in this case, or put a negative voltage below -0.1 V or damage will likely result.


 Here's our spaghetti demo circuit with the different parts labeled...

    Once you have wired up the circuit, it's time to try out the software. Once you fire it up, the display portion will be blank. Click the Open button, and after a second or two, you should see the image to the left.
    The  software settings are as follows:
        Clock Frequency sets the ADC sample frequency. This is only used for frequency calculation, and the Time(uS) value. IT does NOT set the actual sample frequency.
        Vref sets the max voltage that can be measured. In the schematic, the Vref+ is set to 5V, but the actually measured value was 4.99V. This is used for the Voltage(V) value, as well as the Calc V delta function. It does NOT change the actual Vref+ in the circuit.
        Horizontal Scale is adjustable from 0.1 to 10 in 0.1 increments. It changes the time scale in the display to see higher or lower frequencies.
        Updates/sec changes the display update rate.
        Channel Trigger is used to change which channel is used for triggering.
        Trigger Level is a slider to set the value that the signal must cross in order to start the display.

        The software also has 2 simple functions: Calc Freq and Calc V delta. The Calc Freq function takes 2 points on the display and calculates the frequency from them. The only caveat to this is the accuracy of the Clock Frequency box to the actual Clock Frequency. With the settings above on our circuit we had an error of about 3.5%. The software will ask you for 2 points, select them on the display, and a message box will show you the calculated frequency.
        The Calc V delta is very similar to the Calc Frequency only this time it will show the voltage between 2 points. It will subtract the two points (point 1 - point 2), so you can have a negative voltage. Accuracy is dependent on the Vref value. In this case the error was less than 1%.

        The astute ones out there probably noticed that the waveforms in the screenshot are not lined up where they should. The peaks of ChannelB should be lined up with the negative edge of the square wave. The two channels are not sync'd properly and ChannelB is also jittery. I have tried a few ways to sync the two with little change at this point. In the future I plan on making a more robust Oscilloscope using 60Ms/s converters and hopefully, we will solve the sync problem as well.

        In summary, this little project is a great way to look at waveforms for low cost. With some additional circuitry on the front end, you can make this rather versatile (namely protection on the input and the ability to capture AC). This project was less than $20, not including the Universal to USB Converter. Not bad for basic scope!

Copyright © 2012 by 100RandomTasks. All rights reserved.

Site Admin,
Jan 21, 2012, 7:15 AM