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.

ADS1192 data acquisition error

Other Parts Discussed in Thread: ADS1192

Hi ,

I am using Stm32f207 and IAR workbench.

I'm kidda new in here. please help me out T_T.

Unlike other sensors, ads1192 do not have output registers.

How can I read the data and which from registers with SPI?

I have been working on this stuff more than 7 days . I read manuals 20 times. still, I don't get this.

This is my setup for  SPI. 

SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
    SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
    SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
    SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
    SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
    SPI_InitStructure.SPI_NSS = SPI_NSS_Soft ;
    SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32;
    SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
    SPI_InitStructure.SPI_CRCPolynomial = 7;
    SPI_Init(SPI1, &SPI_InitStructure);

and for the data reading, I use this structure;

  GPIO_ResetBits(GPIOA, GPIO_Pin_4); // CS on and off
  while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
  SPI_I2S_SendData(SPI1, address);
  while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
  SPI_I2S_ReceiveData(SPI1);
 
  while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET);
  SPI_I2S_SendData(SPI1, 0x00);
  while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
  SPI_I2S_ReceiveData(SPI1);
 
  GPIO_SetBits(GPIOE, GPIO_Pin_3);

return SPI_I2S_ReceiveData(SPI1);

 

T_T can anyone help me plz.

Thanks

 

Min

 

  • Hey Min,

    You're right; this device does not have an addressable data output register. In fact, reading the data on this device is probably easier than having to address a register. If using the default conversion mode, data will begin to shift out automatically when SCLKs are sent to it after data is ready. To read conversion data, you just need to wait for the DRDY signal's negative edge, then just start sending SCLKs. For some microcontrollers, the act of sending SCLKs is just as simple as sending dummy data out on the MOSI line (i.e. 0x00s). You'll need to send as many SCLK periods as there are bits of data and status to read. Make sure your timing is consistent with the Timing Requirements shown on page 8 of the datasheet. If you think you're communicating correctly and you still can't read anything, the first step I would take would be to connect an oscilloscope or logic analyzer to the SPI communication lines and look at how the transaction is taking place to figure out what is wrong.

    Regards,
    Brian Pisani
  • I tired almost all and i still couldnt get a return value.

    I start to wonder that this chip may be defected. Is there any way i can check this chip without replacing with another?

    Thanks

  • Seungmin,

    I'd recommend connecting an oscilloscope to the SPI lines as well as the DRDY line to 1) check if DRDY is pulsing to verify the device is converting 2) to see if your SPI communication transaction looks like the timing that the datasheet says the device will expect. To otherwise verify the device is working properly, check the supply voltages and the RESET and PWDN pins. If those are ok, try writing and reading registers.

    Regards,
    Brian Pisani
  • Thanks Brian.
    Finally I got values from my ads1192.