This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: DAC81416EVM
Hi,
I am not seeing any output when using 81416EVM. Below are details about my setup.
I am using SPI on Arduino Due to update DAC voltages.
Please help.
Connections:
Arduino DUE SPI Pin 3 -> 81416EVM J8.8
Arduino DUE SPI Pin 4 -> 81416EVM J8.4
Arduino DUE 13 -> 81416EVM J8.2
Arduino DUE GND -> 81416EVM J1.31
J7.7 - 15V
J7.6 - GND
J7.5 - 5V
J7.4 - 3.3V
J7.3 - GND
J10: 2-3
Arduino IDE Code:
#include <SPI.h>
int CSdac =13; //Pin on Arduino connected to DAC on tuning board
void setup() {
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE1));
analogReadResolution(12);
SPI.begin(CSdac);
Serial.begin(115200);
pinMode(CSdac, OUTPUT);
digitalWrite(CSdac, HIGH);
}
void loop() {
Serial.println("Start");
// Set range 0-5V
digitalWrite(CSdac, LOW);
SPI.transfer(0x0A);
SPI.transfer(0x00);
SPI.transfer(0x00);
digitalWrite(CSdac, HIGH);
// Set range 0-5V
digitalWrite(CSdac, LOW);
SPI.transfer(0x0B);
SPI.transfer(0x00);
SPI.transfer(0x00);
digitalWrite(CSdac, HIGH);
// Set range 0-5V
digitalWrite(CSdac, LOW);
SPI.transfer(0x0C);
SPI.transfer(0x00);
SPI.transfer(0x00);
digitalWrite(CSdac, HIGH);
// Set range 0-5V
digitalWrite(CSdac, LOW);
SPI.transfer(0x0D);
SPI.transfer(0x00);
SPI.transfer(0x00);
digitalWrite(CSdac, HIGH);
// Power up device
digitalWrite(CSdac, LOW);
SPI.transfer(0x03);
SPI.transfer(0x0A);
SPI.transfer(0x84);
digitalWrite(CSdac, HIGH);
// Power up all channels
digitalWrite(CSdac, LOW);
SPI.transfer(0x09);
SPI.transfer(0x00);
SPI.transfer(0x00);
digitalWrite(CSdac, HIGH);
// Enable broadcast all channels
digitalWrite(CSdac, LOW);
SPI.transfer(0x05);
SPI.transfer(0xFF);
SPI.transfer(0xFF);
digitalWrite(CSdac, HIGH);
// Write code to all channels
digitalWrite(CSdac, LOW);
SPI.transfer(0x0F);
SPI.transfer(0xFF);
SPI.transfer(0xFF);
digitalWrite(CSdac, HIGH);
delay(100000000);
}
Hi Dharma,
The hardware configuration and register writes are seems correct. please share the oscilloscope snaps of SPI lines(CS, SCLK, SDI, SDO). We will see if is there any timing issue there.
Hi Anbu,
Here is a screenshot of SPI. I just tried writing a single 8 bit data (0x0A) to check the validity of data.
Is the device in power down mode by default? If yes, how to change it?
Also is there anything to do with TOGGLE pins?
Hi,
I can see a 10KOhm resistance with multimeter connected between GND (J1.31) and OUT8 (J1.2). So I am guessing the DAC is not getting powered on.
This is an urgent requirement. Please let me know if I am missing something.
Hi Dharma Paludugu,
It seem you SPI timing is wrong.
Host controller must place the data on SDI at rising edge of SCLK and device will sample falling edge of SCLK.
Change SPI operating mode as SCLK (CPOL =0 , CPHA =1) and try.
Hi,
I used SPIMODE1 in Arduino. It has CPOL=0, and CPHA = 1.
I will check again. Appreciate your response.
Is of your colleagues in US time zone to help me during the day too?
SPI mode is the issue. The Arduino I am using does not change the mode even though I use different mode in the code. Once it is fixed it is straightforward.
Thanks.