Communicating with SPI DAC

Thread Starter

eb123

Joined Jul 3, 2017
74
It's time to use a o-scope and/or Channel Analyzer to verify the digital signals are at the right place with the right timing.
Is the timing between the Frame Sync and start of transmission defined? The datasheet isn't entirely clear.
 

Thread Starter

eb123

Joined Jul 3, 2017
74
I've just found out that the 5V supply is sending 12v into VDD. The datasheet specifies a maximum of 5.5v, however is it capable of operating at 12v, and if not, have I likely damaged the IC?
 

nsaspook

Joined Aug 27, 2009
16,326
I've just found out that the 5V supply is sending 12v into VDD. The datasheet specifies a maximum of 5.5v, however is it capable of operating at 12v, and if not, have I likely damaged the IC?
Well, that's unfortunate but it's a good thing only the DAC chip was connected.
 

nsaspook

Joined Aug 27, 2009
16,326
And the mbed, but thankfully it's capable of operating at up to 16v. Would you suggest I replace the DAC?
Stresses beyond those listed under “absolute maximum ratings” may cause permanent damage to the device. These are stress ratings only, and
functional operation of the device at these or any other conditions beyond those indicated under “recommended operating conditions” is not
implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
 

Thread Starter

eb123

Joined Jul 3, 2017
74
Ok, so I've replaced the chip, and obtained a new 5v, and 3.3v supply, which I can confirm works.

The code is now as follows:

Code:
#include "mbed.h"
SPI spi(p5, p6, p7); // mosi, miso, sclk
DigitalOut fs(p8);

int main() {
    fs = 0;
  
    uint16_t fixed = 0x4000;
    uint16_t value = 1024;
  
    uint16_t final = value << 2;
    final = fixed ^ value;
  

    spi.format(16,2);
    spi.frequency(1000000);
    wait(1);
    fs = 1;
    wait(1);
    fs = 0;
    spi.write(final);
  
    wait(1);
  
    fs = 1;
  
  
}
At first, OUT, as measured by the voltmeter is around 9mv (usually -9mv). After between 5 and 20 seconds (approx), the voltage spikes to around 1.6v, and once 3.3v.

Cann you explain this delay, and the inaccuracy?
 

nsaspook

Joined Aug 27, 2009
16,326
You need some way of looking at the signals to be sure they match the correct digital format and timing to the correct pins.
 
Top