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.

ADS1248: SPI reading is wrong 1 out of 30 times

Other Parts Discussed in Thread: ADS1248

We are experiencing an SPI communication problem when talking to the ADS1248.

So far I have seen that I am getting incorrect data in the direction from the ADS1248 to the CPU (eg 0x00 when I am supposed to get non zero, or non zero when I am expecting 0x00) .

But it is not easy to tell what is causing this, eg it could be that it  did not understood correctly the request the CPU send to it in the first place.

The problem is reproducable after a few minutes of communication.

In the zip file in attachment the screen en scope plots of such a scenario + a detailed description is (see the readme file).

1651.WrongADS1248SPIResponse.zip

The piece of code that is in the attachment

is a small part of a bigger scenario that is executed continuously (so it is more than just these few lines that are ran repeatedly) The scenario consists out of:

- configuration of the parameters for the new measurement (channel selection, ...)

- wait till the measurement finishes

- run this piece of code to make sure we managed to correctly set up the measurement parameters

- read out the measurement results

 

Every 5 to 10 (don't remember exactly) normal measurements we also do

- a vref measurement

- a measurement using the burnout current sources because we need to monitor the integrity of the cabling to the sensors.

 

  • Hi Johan,

    It is not clear as to whether the device is operating in RDATAC mode or SDATAC.  Power up default operation is RDATAC mode, and what this mode does is automatically update the output register with new conversion results as soon as the conversion period completes.  If you issue a command to read register results and are reading data during this period the output will become corrupted.  If you are continuously reading the register it is best to issue a SDATAC command.  I personally issue SDATAC every time I read and write to the registers as this is the least problematic.

    You can then read results either by RDATA command, or you can return to RDATAC (which saves the command byte having to be issued.)

    Best regards,

    Bob B