Thursday, May 1, 2014

Testing the AD5697R DAC

Yesterday I tested an interesting DAC: the AD5697R. This an interesting 12 bit dual channel Digital to Analog Converter (DAC). I plan to use it on a project where it will susbstitute some operational fixed voltages. 
Using a DAC instead of a potentiometers make those voltages adjustables by the microcontroller that manages all the system. Moreover, as the DAC features an internal reference the voltage values are independent on power supply variations. 

Unfortunately, as is more and more habitual this days the DAC only comes in SMD packages and they are not board friendly at all. This 16 pin device comes in the 3mm x 3mm Lead Frame Chip Scale Package (LFCSP) package and in the 5mm x 4.4mm Thin Shrink Small Outline Package (TSSOP) package. That's tinny!

Adpating the chip to protoboard use

I selected the 16 TSSOP package as it's easier to solder although it features a 0.65 pin pitch that is about 1/4of the standard 2.50 (100 mil) DIP pitch. To test it on a protoboard I used an SMD adapter. The following figure shows the adapter I used before soldering the chip. The image also serves to show the pitch difference between TSSOP and 100 mil DIP.

TSSOP16 Adapter
As is normally the case, the adapter costs more than the DAC chip itself.
This adapter, however, has one problem: It uses dual rows of pins at either side of the chip. That's bad for a protoboard as you will short odd and even pins.
The solution was to extend the adapter after I soldered the chip:

Adapter extension




Using the extension half of the 100mil pitch pins are soldered to the original adapter and the other half to the extension.


Test circuit

So far so good. Time to test the chip.
In order to test the chip I used the F3 Gizmo to send the I2C commands the chip needs to operate.

Test circuit for the DAC
The circuit only needs four main wires: 3V supply, ground and the I2C SDA and SCL lines. A0 and A1 are connected to ground although this is not shown in the above schematic.

Test circuit on the protoboard

Test of the DAC

Once the test circuit is mounted it's time to test the DAC by sending some I2C commands.

The 7 bit I2C address for the DAC is

0 0 0 | 1 1 A1 A0

As A1=A0=0 the address will be:

000 1100 = 0xC

Using the F3 Gizmo ISCAN word whe can check that the I2C channel is operational:

     ISCAN
     0xC

To send data to the DAC we must send 3 Bytes to it's I2C address.

The first Byte indicates the command and the channel.
The 4 MSBs are the command. The command I tried is:

0011 (3h) Write to and update DAC channel n

This command directly writes a binnary data to one or both DAC channels.

The 4 LSBs of the first Byte selects the channel to adress:

    0001 (1h) DAC A
    1000 (8h) DAC B
    1001 (9h) DAC A and DAC B

The two following Bytes to send are the data to send to the DAC. As two bytes are 16 bits and the DAC channels are 12 bits only, the last 4 LSBs bits are discarded.

The DAC uses an internal 2.5V bandgap reference. The full scale (FFFh code) should be 1 LSB below the reference for the selected GAIN=1. If the GAIN pin was at VDD the selected GAIN would be 2 and the full scale value would be one LSB below 5V.

In order to set the A channel to the maximum value we can must send the following data:

  Command: 3h
  DAC addressed: 1h
  Code to send: FFFh
  Last dummy nibble: 0h

We can use the following F3 Gizmo command in order to send the data:

   0xC 0x31 0xFF 0xF0 3 0 I2CT

As a result the output goes to 2.5V as expected.

To set any other value we must compute the 12 bit value. For instance, to set the output to 1V we must use the code:

   code =4096 * 1 / 2.5 = 1638 = 666h

Using the F3 Gizmo that means sending the following command:
   0xC 0x31 0x66 0x60 3 0 I2CT

As you can see from the multimeter reading the response is quite good.

Measuring the response to code 0x666
Having the DAC an internal reference makes very easy to generate exact absolute output values.

The test was a success. Now I can test the rest of the I2C functionality before deploying the DAC in the project.

No comments:

Post a Comment