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.

DAC7750: DAC7750 output not proportional

Part Number: DAC7750


Hello,
I am using DAC7750 for 4-20 mA output in my module. As per datasheet i am writing the DAC value (CODE value) to the DAC7750_WRITE_DAC_REGISTER (0x01) register. However for the CODE values 15-32  we are getting random mA output (Between 8-19 mA). Also for the values 1376 - 1392 output is 4mA, The DAC outputs correct mA for all other values.


void Init_DAC7750()
{
DAC7750_LATCH_Pulse();
SPI_CLR_PIN_HIGH;
__delay_cycles(10); // delay min 40ns
SPI_CLR_PIN_LOW;

DAC7750_Reset();
DAC7750_Nop();
DAC7750_WriteReg ((DAC7750_RANGE_4MA_20MA + DAC7750_OUTEN), DAC7750_WRITE_CONTROL_REGISTER);
DAC7750_WriteReg (0, DAC7750_WRITE_CONFIGURATION_REGISTER);
DAC7750_WriteReg (0, DAC7750_WRITE_GAIN_CALIBRATION_REGISTER);
DAC7750_WriteReg (0, DAC7750_WRITE_ZERO_CALIBRATION_REGISTER);
}


void SetmAOutput(unsigned int guimAOutput)   // the Values 15-32 and 1376-1392 sent to this function.
{
unsigned int Write2DACReg;
_nop();
Write2DACReg = guimAOutput;
Write2DACReg = Write2DACReg<<4;
_nop();
DAC7750_WriteReg (Write2DACReg, DAC7750_WRITE_DAC_REGISTER);//ms_delay(1000);
}

void DAC7750_WriteReg (unsigned int writeValues, unsigned char address)
{
uint8_t wRtospi[3];

wRtospi[0] = address; //addreess
wRtospi[1] = (writeValues& 0xff00) >> 8; //Higher byte
wRtospi[2] = (writeValues & 0x00ff); //lower byte

Write_SPI(wRtospi[0]); //write address to SPI
Write_SPI(wRtospi[1]); //write Higher byte to SPI
Write_SPI(wRtospi[2]); //write Lower byte to SPI

DAC7750_LATCH_Pulse(); 
}

Please check and revert if i am missing anything .
Thank you.



  • Vyankatesh,


    The first thing that I noticed is that the problem seems to involve the codes in intervals of 16, which often is kind of a coding issue. Unfortunately, I'm not much of a coder, so I'm not going to be able to effectively review your code that well.

    Whatever the problem is, but there are ways to help debug it. I would first get an oscilloscope look at the digital lines going in and out of the device. In particular, I would review SCLK LATCH DIN and SDO to see that they don't have any problems with the timing shown on page 13 of the datasheet. If you get the scope shot, please get a picture and post it back here. I would also make sure that the SPI is constructed correctly. For this device DIN is latched on the rising edge of SCLK and I would also make sure that the /CS line is low for the entire SPI transaction.

    One thing to check would be to write the DAC DATA and if you get an incorrect value on the output, try reading back the DAC DATA to see how the device interpreted the received signal.

    How are you measuring the current? Do you use a test resistor and measure back the voltage or are you using an ammeter?

    Regardless, look through my comments and questions and get back to me.


    Joseph Wu