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.

ADS1298: Channel ADC data is garbage

Part Number: ADS1298

I don't know what I am doing wrong but the channel ADC values from ADS1298 are clearly wrong even though the preamble (0xC0) is correct.

I can successfully read ID register and also read / write any other register, so it shouldn't be a problem with the SPI connection.

My ADS1298 configuration is like follows:

- CONFIG1: HR MODE & 1kSPS

- CONFIG2: 0x00

- CONFIG3: PD_REFBUF_ENABLE_INTERNAL, RLD_MEAS_RLD_IN, RLDREF_INT_GEN_INTERNAL, PD_RLD_ENABLE

- CONFIG4: SINGLE_SHOT_CONTINUOUS_MODE

- CHnSET: MUXn_MVDD_SUPPLY_MEASURE

After configuration I send commands START & RDATAC and then call:

HAL_SPI_TransmitReceive(spi_handle, &spiTxBuffer[SingleSampleSize * receivedSample], &spiRxBuffer[SingleSampleSize * receivedSample], SingleSampleSize, 1000);

with:

#define NoOfEcgChannels (8U)
#define NoOfStatusBytes (3U)
#define NoOfBytesPerChn (3U)
#define SingleSampleSize (NoOfStatusBytes + NoOfBytesPerChn * NoOfEcgChannels)

What I expected is basically 0x007FFFFF for every channel (upper limit of ADC value) but instead I get something like this:

00327f81;0035a7d9;0016a863;003c3934;0024d771;002dc914;fff0a0cc;0045374f

ffee0c41;0035b126;00109ff6;ffff9d38;ffe3daf0;ffe897ec;ffe5328b;000dd740

I build the values like this:

const int32_t c1 = (static_cast<int8_t>(spiRxData[offset + 3]) << 16) | (spiRxData[offset + 4] << 8) | spiRxData[offset + 5];
const int32_t c2 = (static_cast<int8_t>(spiRxData[offset + 6]) << 16) | (spiRxData[offset + 7] << 8) | spiRxData[offset + 8];
const int32_t c3 = (static_cast<int8_t>(spiRxData[offset + 9]) << 16) | (spiRxData[offset + 10] << 8) | spiRxData[offset + 11];
const int32_t c4 = (static_cast<int8_t>(spiRxData[offset + 12]) << 16) | (spiRxData[offset + 13] << 8) | spiRxData[offset + 14];
const int32_t c5 = (static_cast<int8_t>(spiRxData[offset + 15]) << 16) | (spiRxData[offset + 16] << 8) | spiRxData[offset + 17];
const int32_t c6 = (static_cast<int8_t>(spiRxData[offset + 18]) << 16) | (spiRxData[offset + 19] << 8) | spiRxData[offset + 20];
const int32_t c7 = (static_cast<int8_t>(spiRxData[offset + 21]) << 16) | (spiRxData[offset + 22] << 8) | spiRxData[offset + 23];
const int32_t c8 = (static_cast<int8_t>(spiRxData[offset + 24]) << 16) | (spiRxData[offset + 25] << 8) | spiRxData[offset + 26];

Any ideas what I am doing wrong? Any help is very much appreciated.

  • Hi,

    Welcome to the E2E forum !!!

    You can check a few things to make sure the device is in the proper operating condition. Please use the link below for Step 2 which lists the voltages for all the device internal pins?

    Another suggestion is to use the internally-generated test signals by setting CHnSET[2:0] = 101, CONFIG2.TEST_FREQ[1:0] = 00, CONFIG2.TEST_AMP = 0, and CONFIG2.INT_TEST = 1 to verify the entire signal chain.

    For digital verification, please use a scope to probe the SPI bus and make sure you are interpreting all the channels correctly with the microcontroller. You can quickly identify the 0x7FFFFF from the scope plot based on your expectation.

    Thanks

    -TC