Hello there,
I used 2 GPIO pins to program DAC5574 but could not make it. I am using VOUTD for voltage output. I am pretty sure I2C code should work. My question is about writing correct slave address, control byte, MS-Byte, and LS-byte to DAC5574:
unsigned char Write_DAC(unsigned char voltagedata)
{
start() ;
write1byte(0x98) ; // DAC5574 slave address
if(check()) write1byte(0x06) ; // check () returns Acknowledge from DAC. if it is true, write DAC control byte =0x06?
else return 0 ;
if(check()) write1byte(voltagedata) ; //write DAC MS data (any value from 0 ~ 256)
else return 0 ;
if(check()) write1byte(0xff) ; // write LS data (don't care, could be any value, right?)
else return 0 ;
if(check()) stop() ;
else ;
return 1 ;
}
Please correct me if I am wrong. I appreciate it!
Fred