The NCO inside each DSP channel can be
configured to produce a square waveform instead of sine/cosine waveforms. This
feature is designed for systems that want to synthesize a clock signal using the DAC
with programmable frequency, phase, amplitude, slew time and duty cycle. Enable this
feature on DSPn by setting NCO_SQ_MODE[n]. This mode is compatible
with all the DDS modes, but is not supported for DUC mode (see the DSP_MODEn). The DDS-SPI mode is the primary use case for this
feature. But if frequency ramping is necessary, DDS-Vector mode or DDS-Streaming
mode can be useful.
The slew time and duty cycle are
adjustable using the SLEW and DUTY_CYCLE registers. The slew time is programmed as a
proportion of the period, so when the NCO frequency is changed, the period;
therefore, the slew time also changes.
The frequency, phase, and amplitude
are controlled in the same fashion as if the NCO was producing sine/cosine
waveforms. This is summarized in Table 7-25.
Table 7-25 NCO Parameter Control Method vs DSP Mode
| NCO Parameter |
Control Method for the NCO Parameter
depends on DSP mode |
| DDS SPI Mode |
DDS Streaming Mode |
DDS Vector Mode |
| Frequency |
FREQ register |
Depends on STREAM_MODE |
Vector Engine |
| Phase |
PHASE register |
Depends on STREAM_MODE |
Vector Engine |
| Amplitude |
AMP register |
Depends on STREAM_MODE |
Vector Engine |
| Slew |
SLEW register |
SLEW register |
SLEW register |
| Duty Cycle |
DUTY_CYCLE register |
DUTY_CYCLE register |
DUTY_CYCLE register |
The square waveform produced by the
NCO is depicted in Figure 7-43.
The duty cycle is adjustable over a
wide range, but the user must never adjust the duty cycle to extreme values that
cause the falling edge of the signal to “collide” with the rising edge. The
supported duty cycle range depends on the SLEW setting and is listed in Table 7-26.
Table 7-26 Supported Duty Cycle Range vs Slew Time
| SLEW Setting |
Slew time as a percentage of the period (25% *
2-SLEW) |
Acceptable duty cycle range [percent] |
Supported range of DUTY_CYCLE register (decimal) |
| 0 |
25% |
25% - 75% |
1024 to 3072 |
| 1 |
12.5% |
12.5% - 87.5% |
512 to 3584 |
| 2 |
6.25% |
6.25% - 93.75% |
256 to 3840 |
| 3 |
3.125% |
3.125% - 96.875% |
128 to 3968 |
| 4 |
1.5625% |
1.5625% - 98.4375% |
64 to 4032 |
| 5 |
0.78125% |
0.78125% - 99.21875% |
32 to 4064 |
| 6 |
0.390625% |
0.390625% - 99.60938% |
16 to 4080 |
| 7 |
0.195313% |
0.195313% - 99.80469% |
8 to 4088 |
| 8 |
0.097656% |
0.097656% - 99.90234% |
4 to 4092 |
| 9 |
0.048828% |
0.048828% - 99.95117% |
2 to 4094 |
Notes about the square wave
generator:
- Square wave mode only makes sense
to use in NRZ or DES2XL DAC output modes (1st Nyquist modes) and with
a frequency < 1/10th the DAC clock rate, otherwise there are not
enough data points during the cycle to define the transition periods.
- The SLEW and DUTY_CYCLE parameters can be changed while the NCO is producing an
output, but the parameters do not go into effect until the DSP receives a
trigger event. Updating these parameters in this way is not clean as the
waveform can glitch to the new waveform. To prevent glitches, the waveform can
be gated low to update the SLEW and DUTY_CYCLE parameters using NCO_SQ_EN.
- When using the square waveform
with DDS Vector mode, use the DDS_HOLD feature so that the vector engine holds
on a vector and keeps producing a waveform when waiting for a trigger. If you do
not use this mode, the output mutes by going to mid-code and does not gate the
square wave into the low state.
- Internally, the square wave
swings from -32768 to +32767 and then is scaled by the mixer. When the DDS
amplitude (AMP) is full scale (32767), this scales the waveform down slightly,
so the output swings from 32767 to +32766.
- Setting the DDS amplituide to 0 is not the same as gating the waveform. Setting
the amplitude to 0 causes the swing to be 0 at mid-code. Gating the waveform low
keeps the waveform at the “logic low” or “minimum level” (for example -32767 if
the DDS amplitude is set to 32767).
- The square wave mode is not compatible with DSP_FORMAT=1.
- In square wave mode, do not set the NCO frequency higher than
FDAC/4.
- The user must take care that the SLEW setting is not too high. If the setting is
too high, the NCO can fail to produce output samples during the transition
period. As a result, the jitter of the resulting signal can be poor as every
edge is rounded off to the nearest sampling period. Better jitter performance
occurs when the the slew time consists of multiple sample periods. The number of
sample periods in the slew time is equal to 0.25 * 2-SLEW[n] *
264 / FREQ[n] (assuming DDS SPI mode). A low-pass
anti-imaging filter on the DAC output can help smooth out the transitions to
produce a smoother clock signal.
- DES2XL mode is advantageous to
use as DES2XL increases the number of points in the transition period. However,
as the DES2x digital filter limits the digital bandwidth, the filter produces
ripple near the transition period that is larger than the square wave amplitude.
Therefore, the square wave amplitude must be backed off by 2-3% to prevent
saturating the digital signal.
- See Bandwidth Optimization for Square Wave Mode on optimization of the
DAC output bandwidth for square wave mode.