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.