Hi,
I'm using DAC8760, and configured it for 4 - 20mA. I've connected 2k and 10 k potentiometers in REFIN and REFOUT respectively. voltage @ REFOUT is 0V. then I disconnected potentiometers from REFIN and REFOUT and connected them to ground thru a capacitor. I've monitored DIN, SCK and LATCH signals on DSO and seems to be OK.
below is the schematic and code, Please guide me, where I'm doing wrong,
#define DAC_CONTROLBITS 0x00553005 #define DAC_ADDRESSBITS 0x00010000 #define DAC_RESETBITS 0x00560001 void Write_Analog_Output( unsigned long int data) { LONG utemp; unsigned int temp, t1; INT8 j, k, temp1, l; utemp = data; temp = (unsigned int) utemp; temp1 = (utemp >> 16); SD_SDI = 0; SD_SCK = 0; for(j = 0; j < 24; j++) { SD_SCK = 1; if(j < 8) { t1 = temp1; t1 = (t1 >> (7 - j)); } else { t1 = temp; t1 = (t1 >> (15 - l)); l++; } if(t1 & 0x0001) SD_SDI = 1; else SD_SDI = 0; for(k = 0; k < 20; k++); SD_SCK = 0; for(k = 0; k < 20; k++); } SD_SCK = 0; SD_SDI = 0; LATCH = 1; for(k = 0; k < 30; k++); LATCH = 0; } void Write_DAC( unsigned long int data) { data = (data | DAC_ADDRESSBITS); Write_Analog_Output( data); } void Init_DAC() { LONG temp; temp = DAC_CONTROLBITS; Write_Analog_Output( temp); } int main() { delay(); uc_init(); Write_Analog_Output( DAC_RESETBITS); delay(); Init_DAC(); while(1) { Write_DAC(0xffff); delay();delay(); } }