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.

Help for ADS1174: data readings are wrong.

Other Parts Discussed in Thread: ADS1174

Hi All,
Presently, we are using ADS1174 to read data for 3 inputs (~2.6 V).   To be simple, we are ignore DRDY pin and just clock four channel data out continuously.  But unfortunately data don't look right.
Coding for reading ADS1174 are shown below too.  ADS1174 is set to SPI TDM Mode, Fixed-Position Data.

Question 1:  Do we have to use the  DRDY  falling edge signal to correctly read data or we might miss Bit15 (MSB)?
Question 2: Could we just continue clock 4 channels data out? This is fine for a "standard" SPI device. We only use one ADS1174 and Din is grounded.  Is the Bit 15 (MSB) always be the first bit?  Is it possible that Bit 13 or Bit 12 become the first bit clocked out?

Question 3:  For our present system,

SCLK: 500 kHz;

CLK: 27MHz;

fsclk/clk=1/54;

Are these settings fine under SPI TDM Mode, Fixed-Position Data mode?
Could it lead to wrong data readings?

If not, could we set CLKDIV  and set ADS1174 to high-speed mode or low-power mode to 
optimize it? 

Any help or comments are welcome.
Thanks in advance!
Charles

void Init_SPI(void)
 {
PORTB_DIR |= 0x0E;
PORTB_OUT |= 0x0E;      //PWND1,2,3
PORTE_DIR |= 0x10;
PORTE_DIRSET  |= 0x80;//0x20 | 0x80;
SPIE_CTRL = 0x54;
SPIE_INTCTRL = SPI_INTLVL_OFF_gc;
 }
uint8_t SPI_MasterTransceiveByte(uint8_t TXdata)
{
uint8_t result;
PORTE_OUTSET |= 0x10;
SPIE_DATA = TXdata;
/* Wait for transmission complete. */
while(!(SPIE_STATUS & SPI_IF_bm));
result = SPIE_DATA;
PORTE_OUTSET &= ~0x10;
return(result);
}
void Get_SPI_ADXL(uint8_t *rev_data)
{
uint8_t i,j;
uint8_t send_data[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uint32_t tmp_data[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
for (i=0; i<8; i++)
{
for(j=0; j<8; j++)
{
tmp_data[j] += SPI_MasterTransceiveByte(send_data[j]);
}
//  _delay_ms(30);
}
for(j=0; j<8; j++)
{
rev_data[j] = (tmp_data[j] >> 3);
}
}



  • Using SPI mode, DRDY is provided to indicate conversion data is ready.  If you ignore this, how do you know where to start reading data?

    If you don't use it because of pin constraints or other, you can use the FS mode of the ADC.  This should interface to most processors fairly straight forward.  see details in the datasheet for setup and timing.

  • Hi Greg,

      Thanks very much for your quick reply. We appreciate it.  We used to use other SPI device and we just clocked data out and they were fine.  For this one we thought it was fine too.  So what you said is that without using DRDY, data clocked out might starts with a wrong BIT leading to random numbers?  Am I right?

    We are actually connect the DRDY to a pin of the MCU that can capture interrupt.  So we could capture the falling edge of the DRDY and start to clock data out, correct?


    Thanks again,


    Charles