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.

DAC8574: DAC not putting out (voltage)

Part Number: DAC8574


Tool/software:

I am trying to interface a DAC8574 to a Raspberry Pi with a custom HAT that I designed and had produced as a PCB.  Here is the section dealing with the DAC8574 and 5.0V Reverence Voltage IC.

I am successfully opening the DAC8574 with

#include <sys/ioctl.h>
int fd_dac;
void DAC_Init(void)
{
   int16_t val;
   uint8_t writeBuf[5], readBuf[2];

// open device on /dev/i2c-1
    if ((fd_dac = open("/dev/i2c-1", O_RDWR)) < 0)
{
    printf("Error: Couldn't open I2C device\n");
   return ;
}
// connect to dac8574 as i2c slave
    if (ioctl(fd_dac, I2C_SLAVE, DAC_Addrs) < 0)
   {
            printf("Error: Couldn't find device on address!\n");
           return ;
   }
}

At least I do not get any error messages.  Following opening the DAC, I
attempt to send data to DAC 1. 

void DAC_Write(uint8_t HighByte, uint8_t LowByte)
{
// set config register and start conversion

    writeBuf[0] = 0x10; // config control register
    writeBuf[1] = 0x0f;          
    writeBuf[2] = 0xff; // send 0x0fff to dac-1
// begin conversion
   if (write(fd_dac, writeBuf, 3) != 3)
  {
       printf("Can't write to register 1\n");
       return ;
   }
return;
}

The data on the oscilloscope appears correct.  But no voltage is being output (as seen by the purple trace 
attached to dac-1.

Any suggestions would be appreciated,

Kind regards,
David

YouTube "Sailing Solo at 70"

  • Hi David, 

    Are you trying to write to channel A (DAC-0 in your schematic), or channel B (DAC-1 in your schematic)? 

    Your write command would update channel A, so just want to make sure you're monitoring the correct channel. 

    Best,

    Katlynne Jones

  • Hi Katlynne, yes i only need to update dac-0 (channel a).  I forgot to put that in when I created my post, but could not find a way to edit the post after I had posted it . . . 

    Thanks for the response, 

    David

  • Katlynne - after reading your post again, are you saying that I am following the correct sequence in software to write to dac-0?  If so, then why am I not seeing voltage above 0V on pin 1 of the dac - specifically I should be seeing 5.0V. . . . . . 

    Thanks,

    David

  • It is sort of amazing this chip is responding to anything.  I have moved it to several different boards, and it maybe the last one I have.  So I was pretty bummed out when lead 16 broke off putting it on the current board.  Being desperate  i broke out the Dremel tool and ground the chip down to expose the interior part of the lead so I could solder a wire to it!

  • Hi David, 

    You said you were monitoring DAC-1. You have a net label called DAC-1 in your schematic. I was trying to clarify if you were attempting to write to that channel, or the channel labeled DAC-0 (pin 1 or channel A in the device) to make sure you were monitoring the channel that you were actually writing to.

    Is the REF5020 populated? Looks like it may not be based on your photo. Can you make sure there is a reference voltage on pin 3 of the DAC? The REF5020 has a 2.048V output. You can't get a 5V output from a 2.048V reference. DAC code 0x0FFF would correspond to a 127mV output:

    Best,

    Katlynne Jones