I am having a problem reading the ADS1292R test signal. Eventually I'd like to read the full ECG signal, but first I need to be able to read the test signal.
HW background: The ADS1292R chip is interfacing with a TIVA 129X series MCU thru SPI interface. The TIVA is running the TI RTOS version 2_14_00_10 OS.
In my HW design:
The ADS DRDY signal does not go into the MCU as an input (but is available only as a test point).
The ADS START & CLKSEL pins are tied to gnd. VrefP is tied to a couple of caps (10uF & 0.1uF) & VerfN is tied to gnd.
I have an external 2.048 MHz clock that drives the ADS chip. Because of this HW configuration I can’t wait for a DRDY rising edge to read the data. But I have injected enough delays in SW where I know that there is at least a 531 uS delay between the START cmd and the RDATA cmd. I also can’t read the data in continuous mode as my data has to be read every 5 mS so that it is synchronized to the other data collected in the system.
Here’s my ADS config code:
void ConfigECGChip(void)
{
// The order of register init is taken form Fig 63 of the ADS1292 data sheet
// Our PWDN/RESET signal is provided by HW (U15:TPS3836K33) 200 ms after power up.
// However, since this can be called at anytime, reset the chip via a cmd as well.
// Reset all registers to default values before changing anything.
SendECGCommand(ECG_RESET);
// It takes 9xFmod cycles (70.3 uS) for the RESET cmd to complete. >>FA Measure wait
for (wait= 0; wait < _9US_COUNTS; wait++) ; // Wait added here for testing only.
// ADS1292R device wakes up in the continuous mode. We must stop the continuous mode so the
// registers can be written
SendECGCommand(ECG_SDATAC);
// Must wait 4xTclk cycles (31.25 uS) for the cmd to complete.
// Wait 18 TClks (~8.8 uS given our 2.048 MHz clk)
for (wait= 0; wait < _9US_COUNTS; wait++) ;
WriteECGRegister( ECG_REG_CONFIG2, ECG_CONFIG2_TEST);
// Wait for the reference to settle. Data sheet does not identify what the min wait time should be.
for (wait= 0; wait < _9US_COUNTS; wait++) ;
WriteECGRegister( ECG_REG_CONFIG1, ECG_CONFIG1_TEST );
for (wait= 0; wait < _9US_COUNTS; wait++) ;
// Set the clock divider for 2.048 MHz clock per sequence specification
WriteECGRegister(ECG_REG_LOFF_STAT, ECG_LOFF_STAT_CLK_DIV_2048KHZ );
for (wait= 0; wait < _9US_COUNTS; wait++) ;
// Turn on the respiration demo mode
WriteECGRegister(ECG_REG_RESP1, TEST_RESP_CONFIG );
for (wait= 0; wait < _9US_COUNTS; wait++) ;
// Configure channel 1 (Respiration) as powered down. (powered down + shorted inputs. See footnote 1 on pg 43 data sheet)
// WriteECGRegister(ECG_REG_CH1SET, (ECG_CHAN_SET_PWR_DOWN + ECG_CHAN_SET_INPUT_SHORTED) ))
// WriteECGRegister(ECG_REG_CH1SET, (ECG_CHAN_SET_INPUT_NORMAL) ))
// WriteECGRegister(ECG_REG_CH1SET, (ECG_CHAN_SET_INPUT_TEMP) ))
WriteECGRegister(ECG_REG_CH1SET, (ECG_CHAN_SET_INPUT_TEST) );
for (wait= 0; wait < _9US_COUNTS; wait++) ;
// WriteECGRegister(ECG_REG_CH2SET, (ECG_CHAN_SET_INPUT_NORMAL) ))
// WriteECGRegister(ECG_REG_CH2SET, (ECG_CHAN_SET_PWR_DOWN) ))
WriteECGRegister(ECG_REG_CH2SET, (ECG_CHAN_SET_INPUT_TEST) );
for (wait= 0; wait < _9US_COUNTS; wait++) ;
// Stop cmd is needed when switching form continuous to pulse mode.
SendECGCommand(ECG_STOP);
for (wait= 0; wait < _9US_COUNTS; wait++) ;
}
Here’s my ADS read code:
for (;;)
{
// Measurement clock invokes this every MEASURE_CLOCK_INTERVAL (5 ms) period
Semaphore_pend (MeasureClockSem, BIOS_WAIT_FOREVER);
SendECGCommand(ECG_START);
// ECG chip settle time (between _START & _RDATA) is 531 uS. Delay injected for testing only.
for (wait= 0; wait < ECG_SETTLE_TIME; wait++) ;
SendECGCommand(ECG_RDATA);
ch1Data[tDIndex] = ECGCh1Data;
ch2Data[tDIndex] = ECGCh2Data;
if( ++tDIndex >= 220)
tDIndex = 0;
}
I’ve tried to read the temperature, respiration or ECG test (1 Hz square wave) data, and all of that data that I read seems to be just noise. Can someone please look at the above code & HW design and determine what may be going wrong? Note that I can read the ADS chip registers and read them back correctly. I also know that I’m reading the correct chip ID (0x73) and the right ECG status (oxC00000)