I'm working with the AD9102 chip and manage to get some of the provided examples to work as expected.
Now I'm trying to simple put out a dc constant value to the DAC setting the waveform selector to the DC Constant selector. The parameters aimed to be used is the Constant generator value using the DAC_CONST parameter, as well as Gain and Offset using DAC_DIG_GAIN and DAC_DIG_OFFSET.
This might seem to be a simple setup but I simple doesn't get it to work right. Either the DAC generates an output using only the DAC_CONST value (ignoring any gain and offset setting), or the opposite.
The setup used is according to below:
SPI, 0x0000 0000
SPI, 0x0001 0000
SPI, 0x0002 0000
SPI, 0x000c 8f0a
SPI, 0x001f 0000
# WAV Config
SPI, 0x0027 0100 # See comments below
# DAC Constant, Gain, Shift
SPI, 0x0031 2000
SPI, 0x0035 2000
SPI, 0x0025 1000
# RAM Update and RUN
SPI, 0x001d 0001
SPI, 0x001e 0001
# Send Trigger, falling edge active low.
Using the setting above it seems that the DAC Constant value is used prior the trigger is sent. 7FFF corresponds to full range. With this board 1 V corresponds to 4mA. The value scales good setting 4000, 2000, 1000 etc. Also negative values like 8000 is working.
Any value on Gain and offset is ignored prior to the trigger is sent
After the trigger is sent, a value that seems to be roughly half maximum seems to be used as input to the gain and offset (from RAM? From somewhere else?). Gain = 0x400 (1) and Offset = 0x000 gives about 0.5 V output. Gain 7FFF gives 1V, 0x2000 0.25 etc. The offset value also scales as expected.
But, the value on DAC_CST is ignored after the trigger is sent.
I also tried the 4 different configurations on the lower 2 bits of the WAVCONFIG register. What changes is that after a trigger the output is not updated at all.
So, what is wrong with the setup or does the chip not support what I like to do? For example, does setup with Constant not support gain and offset and is directly input to the DAC when RAMUPDATE is written? Or do I setup the chip incorrectly for using Constant together with gain and offset?
Appreciate your support.
Typo correction on DAC digital offset address.
[edited by: MartinPe at 7:26 AM (GMT -5) on 9 Nov 2018]