Post Go back to editing

AD7328 output observation.(Decode ADC o/p)

Category: Software
Product Number: AD7328
Software Version: Example project from CCS 9.3

Hi

We are using the Ti Sitara AM5706 processor. We are trying to test ADC and DAC. The DAC output is looped back to ADC.

ADC P/N - AD7328
DAC P/N - AD5734


Observation:

We are able to send data through DAC which we have observed in oscilloscope by probing the lines and able to get the data in ADC channels. But the data we are receiving in ADC are not as per the expectation and we are not able to decode the data.
Note: ADC received data changing when we try to change the DAC transmit data.

We have added the sequence of initialization and data transfers

===========================================================================================================
/*
* DAC Initializations
*/
uint32_t ret;

/*nLDAC*/
HW_WR_REG32(0x4A00358C,0x1000E); //GPIO pinmux Ball-E10
ret = HW_RD_REG32(0x48059134);
ret = ret & ~(1<<10);
HW_WR_REG32(0x48059134 ,ret);for(int i=0;i<99999;i++); //setting Port 4 pin10 OE
ret = HW_RD_REG32(0x4805913C);
HW_WR_REG32(0x4805913C ,ret & ~ (1<<10));for(int i=0;i<99999;i++); //Driving Port 4 pin10

/*nCLEAR*/
HW_WR_REG32(0x4A003590,0x1000E); //GPIO pinmux Ball-D10
ret = HW_RD_REG32(0x48059134);
ret = ret & ~(1<<11);
HW_WR_REG32(0x48059134 ,ret);for(int i=0;i<99999;i++); //setting Port 4 pin11 OE
ret = HW_RD_REG32(0x4805913C);
ret = ret | (1<<11);
HW_WR_REG32(0x4805913C ,ret);for(int i=0;i<99999;i++); //Driving Port 4 pin11

/**************************Output range control +/-10************/
Spi_Word.spi_word = 0xC0004;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(handle, &transaction);
delay(DELAY_VALUE);
/************************************************************************/
/**************************Power control Reg************/
Spi_Word.spi_word = 0x10000F;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(handle, &transaction);
delay(DELAY_VALUE);
/************************************************************************/
/************************************************************************/
/*
* ADC Initializations
*/
/**************************REG1 Initialization************/
adc_Spi_Word.spi_word = 0xA000;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);
/************************************************************************/
/**************************REG2 Initialization************/
adc_Spi_Word.spi_word = 0xC000;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);
/************************************************************************/
/**************************Sequencer Initialization************/
adc_Spi_Word.spi_word = 0xE000;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);
/************************************************************************/

int data;
int i;
uint16_t adc_rxBuf[3] = {0};
while(1)
{
/************************************************************************/
/**************************DAC Reg************/
HW_WR_REG32(0x4805913C ,ret | (1<<10));for(int i=0;i<99999;i++); //Driving Port 4 pin10

Spi_Word.spi_word = 0x47FFC;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(handle, &transaction);
delay(DELAY_VALUE);

HW_WR_REG32(0x4805913C ,ret & ~(1<<10));for(int i=0;i<9999;i++); //Driving Port 4 pin10


/************************************************************************/
adc_rxBuf[0] = 0,adc_rxBuf[1] = 0,adc_rxBuf[2] = 0;
/**************************ADC Channel 2************/
adc_Spi_Word.spi_word = 0x8A11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0xA11;
//adc_Spi_Word.spi_word = 0x8A11;
transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

UART_printf("ADC channel 2= 0x%x\n",adc_rxBuf[0]);
/************************************************************************/
/**************************ADC Channel 4************/
adc_Spi_Word.spi_word = 0x9211;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[1];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0x1211;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[1];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

UART_printf("ADC channel 4= 0x%x\n",adc_rxBuf[1]);
/************************************************************************/
/**************************ADC Channel 6************/
adc_Spi_Word.spi_word = 0x9A11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[2];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0x1A11;
transferLength = 1U;
transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[2];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

UART_printf("ADC channel 6= 0x%x\n",adc_rxBuf[2]);
/************************************************************************/
/**********2nd Transfer****
/**************************DAC Reg************/
HW_WR_REG32(0x4805913C ,ret | (1<<10));for(int i=0;i<99999;i++); //Driving Port 4 pin10

Spi_Word.spi_word = 0x48000;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &Spi_Word;
transaction.rxBuf = &rxBuf[0];
retVal = SPI_transfer(handle, &transaction);
delay(DELAY_VALUE);

HW_WR_REG32(0x4805913C ,ret & ~(1<<10));for(int i=0;i<9999;i++); //Driving Port 4 pin10


/**************************ADC Channel 2************/
adc_Spi_Word.spi_word = 0x8A11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0xA11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[0];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

UART_printf("ADC channel 2= 0x%x\n",adc_rxBuf[0]);
/************************************************************************/
/**************************ADC Channel 4************/
adc_Spi_Word.spi_word = 0x9211;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[1];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0x1211;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[1];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);
UART_printf("ADC channel 4= 0x%x\n",adc_rxBuf[1]);
/************************************************************************/
/**************************ADC Channel 6************/
adc_Spi_Word.spi_word = 0x9A11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[2];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

adc_Spi_Word.spi_word = 0x1A11;
transferLength = 1U;

transaction.count = transferLength;
transaction.txBuf = &adc_Spi_Word;
transaction.rxBuf = &adc_rxBuf[2];
retVal = SPI_transfer(adc_handle, &transaction);
delay(DELAY_VALUE);

UART_printf("ADC channel 6= 0x%x\n",adc_rxBuf[2]);

=================================================================================================================

Output observed:

DAC send data ADC rcv data

0x47FFC (+10v ) 0x871F
0x43FFC (+5v ) 0x8F24
0x41FFC (+2.5v) 0x9324
0x40CCC (+1 v ) 0x9588

  • Hi  ,

    We will look into this.   will contact the product owner and get back to you.

    Regards,

    JC

  • Hi JCCillion

    Thanks for your response we are able to decode the output of ADC and it's working fine.

    Can you give me some idea of how to read the device ID for this chip? Now by probing the external lines, we are able to see the data is coming to ADC but after converting it is coming less. Like if I am sending +10V then I am getting +6V in adc. (Where by probing the lines I m getting +10V )

    We have tested in 2 similar systems having the same ADC and DAC chip but in one system it is failing (only passing for a few voltages).

    DAC O/P voltage : 10 to 0 volt and -5,-10 volt

    Board 1: All voltage is pass 

    Board 2: Only 1V , 0V , and -5V passing

    So to verify if the chip is working fine or not I need to read the device id.

    If you have any suggestions please suggest.

    Regards 

    Jigyansu