Part Number: DAC80504EVM
Hello everyone,
I am working with DAC80504EVM. I want to establish the basic SPI communication between it and Arduino Uno. Currently, the DAC outputs give the midscale value after power up (GAIN = HIGH (2), REFDIV = HIGH(2), RSTSEL = HIGH, LDAC = HIGH, I have left all the default values for the pins on the board). However, when I send simple code 0x080000 via SPI, in order to write 0 on the DAC0 output, or if I send any other code, the outputs stay the same (midscale level = 1.25V). At one point I have accidentally connected VDD and VIO to 3.3V. Could it be that I damaged the DAC since the output of Arduino pins is 5V?
I am sending you attached the image of circuit and the code that I have been trying out.
// include the SPI library:
#include <SPI.h>
const int slaveSelectPin = 10;
int sensorPin = A0;
int sensorValue = 0;
void setup() {
Serial.begin(9600);
// set the slaveSelectPin as an output:
pinMode(slaveSelectPin, OUTPUT);
// initialize SPI:
SPI.begin();
SPI.beginTransaction(SPISettings(16000000, MSBFIRST, SPI_MODE0));
}
void loop() {
// take the SS pin low to select the chip:
digitalWrite(slaveSelectPin, LOW);
SPI.transfer(0x08);
SPI.transfer(0x00);
SPI.transfer(0x00);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin, HIGH);
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue*5.0/1023.0);
}
I would very much appreciate it if anyone could tell me if the form of the code that I am sending is correct or how to check if I destroyed the DAC?
I would appreciate any comment or suggestion.
Kind regards,
Dejana