Post Go back to editing

SDO is abnormal when AD5689 enable daisy chain.

Category: Software
Product Number: AD5689

Hi,

I'm using AD5689 for data acquisition, the MCU is KEA128, and the IDE is S32DS of NXP.

I connected 4 AD5689 together and enabled daisy chain, reference data sheet P19.

But I didn't connect LDAC pin. I saw that this pin can be low, reference data sheet P7.

I got correct data on A_OUT and B_OUT of the first and the second AD5689, but I didn't get correct data on the third and the fourth AD5689.

I found that the SDO data is wrong on the second AD5689, and the waveform as below.

Sometimes I can get correct SDO data on the second AD5689 in debug mode in S32DS IDE, but I never get correct SDO data in release mode.

Following is the setting of daisy chain enable.

AD5689_SetRegisterValue(CMD_DCEN_REG, DAC_ALL, 1); //CMD_DCEN_REG =8, DAC_ALL=9


void AD5689_SetRegisterValue(uint8_t command, uint16_t channel, uint16_t data)
{

uint8_t reg[12]={0};
uint8_t rx[12] = {0};

reg[0]=(command<<4)|channel; //cmd+channel
reg[1]=(data>>8)&0xFF; //high 8 bits
reg[2]=data&0xFF; //low 8 bits


reg[9]=reg[3]=reg[6]=reg[0];
reg[10]=reg[4]=reg[7]=reg[1];
reg[11]=reg[5]=reg[8]=reg[2];

AD5689_SYNC_D(0);
SPI_TransferWait(SPI1, rx, reg, 12);
AD5689_SYNC_D(1);
}

And the send data function is like below.

void AD5689_SendData(void)

{
uint8_t spiAry1[12];
uint8_t spiAry2[12];
uint16_t testcnt = 0;
uint8_t rx[12];


//DAC1---CHA---FX
testcnt = 50000;
spiAry1[9] = 0x31; //write and update CHA
spiAry1[10] = (testcnt>>8)&0xFF; //high 8 bits of FX
spiAry1[11] = testcnt&0xFF; //low 8 bits of FX

//DAC1---CHB---FY
testcnt = 50000;
spiAry2[9] = 0x38; //write and update CHB
spiAry2[10] = (testcnt>>8)&0xFF; //high 8 bits of FY
spiAry2[11] = testcnt&0xFF; //low 8 bits of FY

......// set DAC2~DAC4

//transfer data by SPI

AD5689_SYNC_D(0);
SPI_TransferWait(SPI1, rx, spiAry1, 12);
AD5689_SYNC_D(1);

AD5689_SYNC_D(0);
SPI_TransferWait(SPI1, rx, spiAry2, 12);
AD5689_SYNC_D(1);

}