I have some instances of DAC8551 that output is 2V instead of 5V.
VDD is 5Vdc, Vref is 5Vdc.
When I output 65535 with 24bit , it works fine at the beginning. After some use, some boards are giving me 2Vdc output instead of 5V.
Wonder if the chip is bad or my timing is off.
{
AT91F_PIO_SetOutput(PORT_DAC, DAC_CS);
AT91F_PIO_SetOutput(PORT_DAC, DAC_CS_LASER_TEC);
__disable_irq();
AT91F_PIO_ClearOutput(PORT_DAC, DAC_CS_LASER_TEC);
write_dac(dac_value);
__enable_irq();
delay_us(2);
AT91F_PIO_SetOutput(PORT_DAC, DAC_CS_LASER_TEC);
}
#define DELAY2 1
void write_dac(unsigned short dac_value)
{
unsigned int dummy;
unsigned int value1;
value1 = dac_value;
AT91F_PIO_SetOutput(PORT_DAC, DAC_CLK);
AT91F_PIO_ClearOutput(PORT_DAC, DAC_DIN);
for (dummy = 0; dummy < 24; dummy++)
{
unsigned short temp;
temp = 1 << (23 - dummy);
if (temp & value1)
AT91F_PIO_SetOutput(PORT_DAC, DAC_DIN);
else
AT91F_PIO_ClearOutput(PORT_DAC, DAC_DIN);
AT91F_PIO_ClearOutput(PORT_DAC, DAC_CLK);
AT91F_PIO_SetOutput(PORT_DAC, DAC_CLK);
}