Other Parts Discussed in Thread: DAC8562
Hello,
I bought a DAC8563 breakout for bipolar analog output. I am trying to control it with arduino uno but i couldn't manage it.
Pins;
Arduino pin 13 ---- SCLK pin
Arduino pin 11 ---- DIN pin
Arduino pin 10 ---- SYNC pin
LDAC and CLR pins are at GND.
Arduino code;
#include <SPI.h>
const int syncpin = 10;
int command;
void setup() {
// put your setup code here, to run once:
pinMode(syncpin, OUTPUT);
digitalWrite(syncpin, HIGH);
Serial.begin(9600);
SPI.begin;
SPI.beginTransaction(SPISettings(1000000, MSBFIRST,SPI_MODE1));
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available()){
command = Serial.read();
if (command == '1'){
digitalWrite(syncpin,LOW);
SPI.transfer(0x30);
SPI.transfer(0x00);
SPI.transfer(0x03);
digitalWrite(syncpin,HIGH);
Serial.println("LDAC disabled");
}
else if (command == '2'){
digitalWrite(syncpin,LOW);
SPI.transfer(0x17);
SPI.transfer(0xFF);
SPI.transfer(0xFF);
digitalWrite(syncpin,HIGH);
Serial.println("DAC registired");
}
else if (command == '3'){
digitalWrite(syncpin,LOW);
SPI.transfer(0x27);
SPI.transfer(0x00);
SPI.transfer(0x03);
digitalWrite(syncpin,HIGH);
Serial.println("DAC powered up");
}
}
}
I couldnt take any response from my output. Any advice?
Thanks.