Hi all

first of all, I want to thank this engineer zone forum and especially Kenny G. for lots of useful information about AD9910, so besides basic single tone for sine wave generator, I could finally get my triangle waveform going after one week figure out how proper calculation of step size/rate and configuration is, and it does work!

however, my question about triangle waveform that cause me here is the amplitude, what I am trying to do is triangle wave with adjustable frequency(also period) and duty(in %) like function generator we use quite often.

And for amplitude, it's okay a fixed value for now and I can amplify it externally. in detail,

I set my full swing current at 20mA with external resistor 25 ohm, I can get 0.5V maximum output not exceed the restriction of current output+/-.

Like I said I don't care about amplitude at this point, I set upper/lower limit to maximum value(0x00000000, and 0xFFFFFFFF), and output type to cosine, FTW to 0 as Kenny G. suggests in AD9910 Dig Ramp Mode Capabilities

and I expect full range will perform as what we see in single tone mode yields 0V~0.5V at Iout and 0.5V to 0V at IoutB(inverse).

however, what I get is the triangle amplitude sweep(DRG) looks symmetric to a bias voltage (1/2 full range)

when I use a instrument-amp circuit

trying to turn output signal from single end to a bipolar(+ and -) output with gain = 2, I get

if I set output type to sinewave, it appears to be even smaller(likely half of the amount of cosine output)

could anyone help me understand where the problem is or this is what it could produce, so I know I have to add a bias circuit to my differential amplifier.

plus I attached my circuit about AD9910, and my code(HMI_AD9910.c/.h) to control it through SPI from a microcontroller (especially two function named "AD9910_triangle_wave" and AD9910_single_tone")

Any thoughts will be appreciated.

Wade

Attached is the new schematic as promised. I did not show the filter, which would insert between points A and B and the two R's at the input to the X1 circuit.

The X1 circuit amplifies the balanced input signal (at points A and B) by a factor of n. This is shown at point D, which replicates the original problem you had. Namely, the signal swing is from zero to some peak value (this is expected behavior) rather than the sawtooth swinging about zero as desired.

Note the only thing necessary to produced the desired output is to shift D negative by 1/2 the peak-to-peak swing. The result would be a sawtooth signal that swings equally about zero as desired.

The X2/X3 circuit provides the 1/2 peak-to-peak component. The R2-C2 time constant should be chosen to accommodate the lowest expected sawtooth frequency. Note that any reduction in sawtooth amplitude will require some settling time per the R2-C2 time constant. Of course, you could get fancy and replace R2 with a controllable switch to discharge C2 quickly (but momentarily) whenever you change the sawtooth amplitude in the negative direction.

The X4 circuit subtracts the 1/2 peak-to-peak value from the signal at D to provide the final output. That is, D shifted negative by 1/2 its peak-to-peak value.