ad1938 output

Just got confussion regarding DAC output,
When I send 0, I have 1.5V - OK,
when I send 0x800000, I have 40mV - OK
but when I send 0x7FFFFF I have only 1.5V (same like 0), I should have something around 2.8V?

When I am sending FS sinusoid (0x7FFFFF, 0x800000) I have nice sine wave, 2Vpp, but this sine wave is not symetrical around 1.5V

Please advice what possibly I could make wrong.



  • +1
    •  Analog Employees 
    on Oct 24, 2017 7:14 PM

    Hello Slawek,

    I think you have an error for the incoming serial port setup mismatch. Either the DAC side or the part that is transmitting the signal. If you are setup for a 1-BCLK SDATA delay on the DAC side and the transmitting device does not then the sign bit gets truncated and the waveform looks strange. So check the SDATA Delay setting. Then the BCLK Active Edge setting is also important.

    To show my point I will explain 2's-compliment and show what the data looks like for others who may read this.

    There  are two things going on here. First is that the DAC uses a 2's-compliment number as an input.

    The second is that the output is riding on a common mode voltage. This is needed because the part does not use a bi-polar power supply so it has no way to drive anything negative. So instead you make a "0" signal equal ~1.5V, then it can swing positive or negative relative to this common mode voltage.

    Now the 2's-compliment number system will function like this:

    (BTW, Wiki has a detailed explanation of this number format if you are interested in going deeper)

    Here is a short list of 24 bit numbers showing how this works. In essence, the MSB is a sign bit so as long as it is a 1 then it is a negative number.

    0111 1111 1111 1111 1111 1111  = 0x7FFFFF

    0111 1111 1111 1111 1111 1110  = 0x7FFFFE




    0000 0000 0000 0000 0000 0010 = 2

    0000 0000 0000 0000 0000 0001 = 1

    0000 0000 0000 0000 0000 0000 = 0

    1111 1111 1111 1111 1111 1111 = -1 = 0xFFFFFF

    1111 1111 1111 1111 1111 1110 = -2 = 0xFFFFFE




    1000 0000 0000 0000 0000 0001  = 0x800001

    1000 0000 0000 0000 0000 0000  = 0x800000

    So now imagine if the MSB is getting lost and the DAC is reading the bit next to the MSB as the actual MSB. Then an 0x7FFFF input is actually being read as a 0xFFFFFE because the MSB is being lost in the 8-bit padding of data in the 32 bit data slot. The LSB will now always be a zero.

    If you have the serial port setup mismatched in the other direction, then the MSB (the sign bit) will always be a zero. Then the sign wave will be from 1.5V and up and if you have a full scale signal then it will look strange.

    Anyhow, look into the serial port setup more carefully.

    Dave T