Skip to main content

Using the Mini 6410 I2C bus with a Maxim MAX520 (DAC) IC

Hi all,

When I was teenager I spent a lot of hours designing circuits, soldering ICs on PCB and having fun with breadboards.

Now, after almost 20 years I decided to play once again with breadboards and ICs (it helps me to think I'm still young ;-) in order to learn how the I2C bus works and what can I do with my new FriendlyARM Mini 6410.

What I'm going to describe here is my experiment with the Maxim MAX520 IC (the one in DIP package!) connected to the Mini6410 by the I2C 2 wire bus.

The Max 520 IC is a Quad 2-Wire Serial 8-bit DAC. Here you can see some details taken from the datasheet:

and here you can see a typical application circuit (more or less the same I used for my experiment)

My goal was to set the output of DAC0 (pin OUT0) to a full scale value (3.3 V) and half scale (1.6 V) from a simple C language program.

I decided to set to zero all the addresses of the MAX 520 (pins AD0, AD1 and AD2 connected to GND), in this case the I2C bus address of my chip is 0x28.

Finally I used VDD (3.3V) as a voltage reference for the DAC0 (pin 4 to VDD) and I used a common ground both for digital and analog ground (pin 5 and pin 6 to GND).

At the end I connected the Mini6410 SDIO connector to the breadoboard in this way:

VDD_IO => VDD of the breadboard

GND => GND of the breadboard (analog and digital GND are connected together)

I2CSCL => pin 7 MAX 520 

I2CSDA => pin 8 MAX 520

 

The SDIO connector pins are the following:

 

Here you can see the breadboard with all the connections:

 

After the power up I used i2cdetect to see the peripherals attached to the I2C Bus. Here is the result:

 

As you can see there are some peripherals on the Mini 6410 I2C bus. The 0x28 is the address of the MAX520.

 

At this point the last thing to do is programming the DAC chip. I wrote a very simple C program to set the DAC0 output to half scale value. Here is the code:

This is a simple user space program for the chip via I2C bus. The write operation sends to the bus 2 bytes: the first one is set to zero (this is the command byte) and the second one is set to 0x7F -half scale- (this is the output byte).

The write operation to the 0x28 address sends to the bus the following bytes:

(taken from MAX520 Datasheet)

 

After compiling the C program (with arm-linux-gcc compiler!) I run it on the board ( ./a.out) and the result was:

My multimeter shows 1.59 V which correspond to half scale (DAC 0 V reference is VDD_IO).

 

I hope this post will be useful to someone and if there are comments or questions please leave me a reply, I would like to know if there is someone which is doing tests like me, to exchange ideas and opinions.

 

At the end of this post, please let me thank Maxim company for the several samples they delivered to me for free (including spedition).

 

Keep in Touch!

Paolo