DAC on Teency 3.5

Status
Not open for further replies.

Lorenzo

Well-known member
Hi everybody,

I am trying to control an DAC (MAX532 BEPE) from Teency 3.5.
I have tryed both the unipolar and bipolar connections as reported in the datasheet:https://datasheets.maximintegrated.com/en/ds/MAX532.pdf
using the code at the following link:
https://www.arduino.cc/en/Tutorial/DigitalPotControl
(I have only changed the pin numbers to make properly connections with Teency 3.5)
I am powering the circuit by means of a CUI INC DC/DC converter PYB30-Q24-T515
https://www.arrow.com/en/products/pyb30-q24-t515/cui-inc

I can't read anything from the output of the DAC with the scope and I think one DAC get burned.

Do you have any suggestions?
Thank you
 
No crystal sphere here to see what happened. No wild guessing around either. Facts please, respect the forum rule and don’t link only data sheets and anonymous example code but publish your specific schematic and your specific code, and other detailed project information like oscilloscope pictures of the SPI data stream from the Teensy to the DAC.
 
These are my connections on the DAC MAX532:

Pin Connected to

1 Shorted to 3
2 5V
3 Output pin
4 GND
5 N/C
6 N/C
7 N/C
8 N/C
9 DC Power -15 V
10 GND
11 Teency SCLK
12 N/C
13 Teency MOSI
14 Teency Pin10
15 GND
16 DC Power +15 V

I have inserted 10uF capacitors between +15V and GND, -15V and GND, 5V and GND.
The GND is in common with Teency GND and the 5V with Teency Vin.

Are the connections correct?
I think so (I have taken them from the datasheet) but the ADC seems to be burned with this configuration.
Thank you for any suggestion.
 
Well consider reading the datasheet again. The example code which you did not post but provided a link to is designed for a different kind of device with different data requirements so naturally it will not work. The MAX532 needs 24 bits transmitted to it, first 12 bits would be DACA and second 12 would be for DACB.
 
Well consider reading the datasheet again. The example code which you did not post but provided a link to is designed for a different kind of device with different data requirements so naturally it will not work. The MAX532 needs 24 bits transmitted to it, first 12 bits would be DACA and second 12 would be for DACB.

Thank you Donziboy2 for your suggestion. The code is wrong for sure. But before I try a different code I have to be sure about the connections because I have already burnt one DAC. Are the connections that I have reported in the previous post correct?
Thank you so much.
 
I dont see anything that stands out. You should consider connecting DACB pins even if you don't connect the output to anything. Some devices don't like floating pins like that.

There is also a warning in the Absolute ratings section about the -15V rail. If it ever rises above +0.3V it could cause damage to the chip.
Without pictures and a schematic we can only guess at what happened with the connections. I seriously doubt that a coding mistake would damage the chip.
 
Thank you for your help Donziboy2.

Now my DAC MAX532 seems to work, the connections for the unipolar mode are as follows:


Pin Connected to

1 Shorted to 3
2 10V (I used a KA78L05A linear voltage regulator)
3 Channel A Output
4 GND
5 GND
6 Shorted to 8
7 10 V
8 Channel B Output
9 DC Power -15 V
10 GND
11 Teency SCLK
12 N/C
13 Teency MOSI
14 Teency Pin10
15 GND
16 DC Power +15 V

I have inserted 10uF and 0.1uF capacitors between +15V and GND and between -15V and GND; a 10uF capacitor between 5V and GND.
The GND is in common with Teency GND and the 5V with Teency Vin.

Here is my code to get a sinusoidal signal from the DAC:

Code:
#include <SPI.h>

int channel_A = 0;
int channel_B = 0;
float pi=3.14;
float freq=1.0f;

// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;
int cycles=0;


void setup() {
  Serial.begin(115200);
  // set the slaveSelectPin as an output:
  pinMode(slaveSelectPin, OUTPUT);
  // initialize SPI:
  //SPI.setClockDivider(SPI_CLOCK_DIV16);
  
  SPI.setMOSI(11);
  //SPI.setMISO(12);
  SPI.setSCK(13);
  
  SPI.begin();
}
      

void loop() {
   

      float t=millis()/1000.0f;
      
      channel_A=(int) (2000.0f*sin(t*2*pi*freq)+2000.0f);
      channel_B=(int) (2000.0f*sin(t*2*pi*freq+pi/2)+2000.0f);

      SPI_write(channel_A, channel_B);
      delay(1);
}

void SPI_write(int channel_A, int channel_B) {

  byte byte_0 = channel_B >> 4;
  byte byte_1 = ( channel_B << 4 ) | ( channel_A >> 8 );
  byte byte_2 = channel_A & 255;
    
  digitalWrite(slaveSelectPin, LOW);
  SPI.transfer(byte_0);
  SPI.transfer(byte_1);
  SPI.transfer(byte_2);
  digitalWrite(slaveSelectPin, HIGH);

}

Unfortunately the signal is really noisy (see the picture).

TEK0002.JPG

What could it be due to?
Thank you.
 
Status
Not open for further replies.
Back
Top