Interfacing to MAX5724 DAC
hi,
i have max5724 8 channel 10 bit dac's connected due, believe have wired correctly, when try write value doesn't seem output anything. either misunderstood datasheet in wiring or im writing incorrectly it. since have ldac connected gnd think can use coden command on page 21 of datasheet.
a link datasheet:
http://datasheets.maximintegrated.com/en/ds/max5723-max5725.pdf
here code use write:
wiring:
1 = 5v
2 - 9 = output
10 = 5v
11 = 5v
12 = mosi (middle pins)
13 = miso (middle pins)
14 = sck (middle pins)
15 = pin 52
16 = output
17 = 5v
18 = gnd
19 = gnd
20 = gnd
i have max5724 8 channel 10 bit dac's connected due, believe have wired correctly, when try write value doesn't seem output anything. either misunderstood datasheet in wiring or im writing incorrectly it. since have ldac connected gnd think can use coden command on page 21 of datasheet.
a link datasheet:
http://datasheets.maximintegrated.com/en/ds/max5723-max5725.pdf
here code use write:
code: [select]
#include <spi.h>
#define cs 52
void setup()
{
serial.begin(115200);
spi.begin(cs);
spi.setbitorder(msbfirst);
spi.setdatamode(cs, 1);
spi.setclockdivider(cs, 3); // 28mhz
pinmode(cs, output);
}
void loop()
{
digitalwrite(cs, high);
digitalwrite(cs, low);
static int value = 1024;
if (value >= 1024)
{
value = 1024;
}
byte msg1 = 0b10001000;
byte msg2 = (byte)(value>>2);
byte msg3 = (byte)(value);
msg3 = msg3 | 0b00000011;
// byte msg1=0b01010100; // 01111111
// byte msg2=0b00000001; // 11111111
spi.transfer(cs,msg1,spi_continue);
spi.transfer(cs,msg2,spi_continue);
spi.transfer(cs,msg3,spi_last);
delay(4000);
}
wiring:
1 = 5v
2 - 9 = output
10 = 5v
11 = 5v
12 = mosi (middle pins)
13 = miso (middle pins)
14 = sck (middle pins)
15 = pin 52
16 = output
17 = 5v
18 = gnd
19 = gnd
20 = gnd
quote
connected dueon due spi pins not on same pins other arduinos.
you can them on icsp header.
you can of course bit bang signals on ever pins want mean different software.
Arduino Forum > Using Arduino > General Electronics > Interfacing to MAX5724 DAC
arduino
Comments
Post a Comment