This article describes how a PC-controlled Waveform and Timing Generator (WTG) Instrument was developed using the Opal Kelly XEM3001 FPGA-USB module mated with an Optiphase custom adapter PCB. The WTG Instrument was developed to support R&D instrument development where fully custom and fully embedded solutions are not practical.
The WTG Instrument functions the same as a bench-top waveform generator, except it is only controllable from a PC application via a USB connection. However, in addition to providing features found in a bench-top waveform generator like high speed standard waveforms (sine, square, triangle, ramp, and saw-tooth), custom waveforms, and 10 MHz reference clock in and out, the WTG also has three low speed analog outputs, three 5V TTL outputs, two LVDS outputs, and a USB to RS232 interface.
A. System Clock
- System Clock source can be Opal Kelly PLL, External 10MHz Reference Clock, or On-Board, Low-Jitter, Fixed Oscillator.
- Programmatically controlled (if Opal Kelly PLL).
- Typically 100MHz (if External 10MHz Reference Clock, then multiplied by 10).
The Opal Kelly module (left) and the
B. External Clocks
Optiphase custom adapter PCB (right)
- 10 MHz External Clock Input (LVTTL, LVDS, LVPECL depending on fixed hardware option)
- Two Programmable External Clock Outputs (LVPECL and 5V TTL capable of driving into 50 ohms).
The Opal Kelly module mounted on the
C. High Speed Analog Output
Optiphase custom adapter PCB
D. Low Speed Analog Outputs
- Standard waveforms (sine, square, triangle, ramp, sawtooth) and custom waveforms.
- Update rates of 50, 25, 12.5, or 6.25 MHz (assuming 100 MHz system clock).
- Up to 16,384 point waveform.
- 16 bit resolution.
- Single-ended output (-4.2V to +4.2V, can be hardware configured to a lower range).
- Differential output (-8.4V to +8.4V, can be hardware configured to a lower range).
- Hardware configured Low Pass Filter.
E. Digital Outputs
- Three low speed analog outputs are available and one of the three can be programmed as a standard or custom waveform synchronous with the high speed analog waveform. So there are either three DC outputs or two DC outputs and one low speed waveform output.
- Maximum update rate of 375 KHz.
- Up to 1,024 point waveform.
- 14 bit resolution.
- Single-ended output (0 to +4.2V, can be hardware configured to a lower range).
- Hardware configured Low Pass Filters on all outputs.
F. USB to COM Port (RS232) interface
- Three 5V TTL capable of driving into 50 ohms and two LVDS.
- 3.3V LVCMOS copies of 5V TTL, LVDS (and 5V TTL External Clock) output signals are also provided.
- Programmable repetitive pulsed output, synchronous with the analog waveform(s).
- Programmable pulse delay, width, separation, number of pulses, and polarity.
- Digital Outputs can also be setup as manually controlled, tied to any other digital output, or tied to the start of waveform outputs.
- A COM port (RS2332) on the WTG Instrument allows the PC application to also control and communicate with another device via an RS232 interface between the WTG Instrument and the other device, so no RS232 cable to the PC is needed, just the USB cable.
- Programmable baud rate (2,400, 4,800, 9,600, 19,200, and 38,400).
- Programmable termination character (Carriage Return, Line Feed, or None).
- Receive Buffer overflow detection
A PC application was developed by Optiphase to control the Waveform and Timing Generator Instrument. The application contains three tabs. The first tab, Setup
, is used to connect to the instrument, setup the clocks, and display the hardware options, configuration options, and power status as illustrated below:
have a white background and Indicators
have a grey background.
The second tab, Waveform & Timing Outputs
, is used to setup the Waveform Frequency, the High and Low Speed Waveforms, the Digital Timing Outputs, and to start the Waveform and Timing Outputs as illustrated below:
In the screenshot above, the high speed waveform was setup as a sine wave and the low speed waveform was setup as a ramp wave. Both were setup using DAC counts, but Volts can also be selected as the units for waveform amplitude. The amplitude and offset can be adjusted and the waveforms can also be shifted in time.
- TTL-1 was setup for manual control.
- TTL-2 was setup to transition when waveform and timing outputs start.
- TTL-3 was setup to pulse when waveform and timing outputs start.
- LVDS-1 was setup to output two pulses of different delays and pulse widths per waveform cycle.
- LVDS-2 was setup to output a pulse train of 100 pulses of common pulse width and separation per waveform cycle.
Each of these five output signals also has a 3.3V LVCMOS output copy that is available on the WTG Instrument.
The timing outputs modes for each of the five digital outputs are setup in the Timing Output Modes
tab within the Waveform & Timing Outputs
tab as illustrated below:
The last selection will either say "Single or Double Pulse" or "Pulse Train" depending on the configuration file loaded into the Instrument's Opal Kelly FPGA.
When the application is launched or when the WTG Instrument is first connected, the default configuration is loaded into the Instrument's Opal Kelly FPGA. The configuration can be changed via the Configuration Menu which opens the Edit Instrument Configuration dialog box as illustrated below:
The Edit Instrument Configuration
dialog box allows the user to change the configuration for the System Clock, the High and Low Speed Digital to Analog Converters (DACs), and the Digital Timing Outputs.
High Speed and Low Speed DACs:
- Supplied by Internal PLL and Dividers (valid for Instruments with "Standard" Clock Hardware Option) or…
- Supplied by External 10MHz Reference Clock (valid for Instruments with "Standard" Clock Hardware Option) or…
- Supplied by Internal, Low-Jitter 100 MHz Clock (valid for Instruments with "Low-Jitter" Clock Hardware Option)
Digital Outputs (TTL-1, TTL-2, TTL-3, LVDS-1, LVDS-2):
- The High Speed DAC Waveform can contain up to 16,384 points, but the Low Speed DAC waveform is disabled (DC output only) or…
- The High Speed DAC Waveform can contain up to 14336 points and the Low Speed DAC waveform can contain up to 1,024 points
- Output Mode is selectable including Single or Double Pulse or…
- Output Mode is selectable including Pulse Train
When the OK
button is pressed, the appropriate configuration file (bit file) is loaded into the Instrument's Opal Kelly FPGA.
The High Speed and Low Speed Waveforms can be displayed via the View Menu
as illustrated below:
In the picture above, the high speed waveform was setup as a custom waveform, and a 1,022 point waveform from a CSV file was opened.
Last but not least, the third tab, COM Port
, is used to communicate to an RS232 device as illustrated below:
About the author
John Dailing graduated from UC Davis with a BSEE in 1993 and has been an electronic design engineer for 18 years. Prior to college, John served six years as a nuclear operator in the US Navy. John is currently a Sr. Design Engineer doing PCB, Instrument, and System design and Verliog, LabVIEW, and C programming for Optiphase, a small company in Van Nuys, CA specializing in optical interferometric instrumentation for the Oil and Gas, Medical, Academic, Government, and Defense industries.
Prior to joining Optiphase in 2007, John had worked mostly at small companies, like Optiphase, which typically have a need for his diverse talents in areas such as analog, digital, FPGA, embedded, control systems, wireless, imaging, optoelectronics, PCB layout, and software. John also worked at UC Irvine from 1996 to 2001, providing engineering support for research in the Physics Department. John can be contacted at email@example.com