MityDSP Documentation Index
tcDspAwgDual

Introduction

The tcDspAwg class may be used to provide access to a Dual AWG core. Each instance of DspAwgDual provides the capability to output two arbitrary waveforms, as defined by a sample RAM of 512 16-bit values, which are 15-bit interpolated across 24-bits of phase. The phase increment per clock may also be configured. The AWG may be started upon software command, or via an external trigger.

When created, the constructor requires a valid base address for the AWG core. The AWG core is not enabled after construction. The Enable() method must be called at least once to enable the outputs.

Each waveform must be configured via the SetWaveformSamples method. In addition, the SetPhase and SetPhaseIncrement methods should be called to set the starting phase and phase increment per clock for each waveform.

There is no limit to the number of instances of tcDspAwgDual that may be created, aside from the design of the FPGA module.

See also:
MityDSP::tcDspAwgDual Class Reference

Example

This is a simple example of tcDspAwgDual creation and usage:

{
unsigned int my_base_addr = 0xB0000180;
tcDspAwgDual *myAwg;
// create an AWG interface
myAwg = new tcDspAwgDual((void *)my_base_addr);
// create sample values (a ramp)
unsigned int values[tcDspAwgDual::gnNumSamples];
for (int i=0; i<tcDspAwgDual::gnNumSamples; i++)
{
values[i] = i*32;
}
// load the waveform table
myAwg->SetWaveformSamples(values, tcDspAwgDual::gnNumSamples);
// set the starting phase for the A waveform (in degrees in this case)
myAwg->SetPhase(180.0, tcDspAwgDual::eeDegrees, tcDspAwgDual::eeA);
// set the phase increment for the A Waveform (in radians in this case)
myAwg->SetPhaseIncrement(0.001, tcDspAwgDual::eeRadians, tcDspAwgDual::eeA);
// trigger internally (i.e. start immediately upon enable)
myAwg->SetExtTrigger(false, tcDspAwgDual::eeA);
// Enable the AWG to output the waveform
myAwg->Enable(true, tcDspAwgDual::eeA);
...
}

  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.