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.

Test signal configuration for ADS1294

Other Parts Discussed in Thread: ADS1294

 Hi all,

I am working on ADS1294 . I am unable to get proper output for test inputs. The SPI communication working properly and the programming environment has three modules

  • Device Initialization.
  • ADS Configuration,
  • Read data from the Slave.

The register mapping configuration is 

  • CONFIG1 =  0x86
  • CONFIG2 =  0x10
  • CONFIG3 =  0xC0
  • CH1SET   =  0x65
  • CH2SET   =  0x61
  • CH3SET   =  0x61
  • CH4SET   =  0x61

Program:

#include "SPI.h" // necessary library
#define drdy 8
#define start 9
#define ss 10
#define mosi 11
#define miso 12
#define sclk 13
uint8_t serialBytes[200];
void setup()
{
Serial.begin(115200);
Serial.println("Starting process");
pinMode(drdy, INPUT);
pinMode(start, OUTPUT);
pinMode(ss, OUTPUT);
pinMode(mosi, OUTPUT);
pinMode(miso, INPUT);
pinMode(sclk, OUTPUT);
digitalWrite(start, LOW);
// SPI.setClockDivider(4);
SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE1));
deviceInit();
adsConfig();
startRdata();
Serial.println("Configuration done!!!");
}
void startRdata() {
digitalWrite(start, HIGH);
delayMicroseconds(5);
digitalWrite(ss, LOW);
delayMicroseconds(5);

SPI.transfer(0x10); // send value (0~255)
delayMicroseconds(5);
// digitalWrite(ss, HIGH);

}
void adsConfig() {
//writeReg(0x14, 0);
writeReg(0x03, 0x80 | 0x40);
//FOR RLD: Power up the internal reference and wait for it to settle
// adc_wreg(CONFIG3, RLDREF_INT | PD_RLD | PD_REFBUF | VREF_4V | CONFIG3_const);
// delay(150);
// adc_wreg(RLD_SENSP, 0x01); // only use channel IN1P and IN1N
// adc_wreg(RLD_SENSN, 0x01); // for the RLD Measurement
writeReg(0x01, 0x80 |0x04 | 0x02);
writeReg(0x02, 0x10); // generate internal test signals
// Set the first two channels to input signal
writeReg(0x05, 0x65); // Test signal
writeReg(0x06, 0x61); // Input shorted
writeReg(0x07, 0x61); // Input shorted
writeReg(0x08, 0x61); // Input shorted
}
void deviceInit() {
delay(100);
spiSendData(0x11);
delay(500);
spiSendData(0x0A);
delay(50);
spiSendData(0x20);
spiSendData(0x00);
int a = readReg(0x00);
if (a == 144) {
Serial.println("Device detected successfully");
} else {
Serial.println("Device not detected");
while (1) {
}
}

}
int spiRecvData() {
digitalWrite(ss, LOW);
delayMicroseconds(5);
int a = SPI.transfer(0x00); // send value (0~255)
delayMicroseconds(5);
digitalWrite(ss, HIGH);
delayMicroseconds(2);
Serial.println(a);
return (a);
}
void spiSendData(int value)
{
digitalWrite(ss, LOW);
delayMicroseconds(5);
SPI.transfer(value); // send value (0~255)
delayMicroseconds(5);
digitalWrite(ss, HIGH);
delayMicroseconds(2);
}
int readReg(int value) {
digitalWrite(ss, LOW);
delayMicroseconds(20);
SPI.transfer(0x20 | value);
delayMicroseconds(3);
SPI.transfer(0x00);
delayMicroseconds(3);
int a = SPI.transfer(0x00); // send value (0~255)
delayMicroseconds(20);
digitalWrite(ss, HIGH);
delayMicroseconds(2);
return (a);
}

void writeReg(int add, int value) {
digitalWrite(ss, LOW);
delayMicroseconds(20);
SPI.transfer(0x40 | value);
delayMicroseconds(3);
SPI.transfer(0x00);
delayMicroseconds(3);
SPI.transfer(value); // send value (0~255)
delayMicroseconds(20);
digitalWrite(ss, HIGH);
delayMicroseconds(2);
}

void loop()
{
//deviceInit();
sendSamples();
}

inline void sendSamples(void) {
if (digitalRead(drdy) == HIGH) return;
sendSample();
}
inline void sendSample(void) {
digitalWrite(ss, LOW);
register int numSerialBytes = (3 * (1+1)); //24-bits header plus 24-bits per channel
uint8_t returnCode = spiRec(serialBytes, numSerialBytes);
digitalWrite(ss, HIGH);
//Serial.println(serialBytes);
}

uint8_t spiRec(uint8_t* buf, size_t len) {
for (size_t i = 0; i < len; i++) {
buf[i] = SPI.transfer(0XFF);
Serial.println(buf[i]);
}
return 0;
}


The output of above code configuration.

Thanks & Regards,
Jagadish B

 

  • Hey Jagadish,

    Could you take a picture of the SPI signals while you are collecting the data?

    Regards,
    Brian
  • Hi Brian,

    The output shown in the snapshot is taken from TESTP_PACE_OUT1. We are actually trying to see the TEST Signal output generated internal to ADS1294 from TESTP_PACE_OUT1. We have also tried to collect the data from SPI in RDATAC mode and status register is read correctly, but when we plot the data obtained from channel 1, we see excessive noise and instead of square wave, we are just seeing some random signal. PFA the snapshots.

    The snapshot indicates the first byte of status reg (MSB) and the other two bytes are also read correctly. Later, the first channel output bytes are not coming as per the test inputs. Kindly help us in this regard.

  • Hello Rahman,

    In order to see the signal at the output of the pace amplifier, you will have to configure the pace amplifier. If the test signal is on channel 1, change the PACE register to 0x01 and probe the "TEST_PACE_OUT2". I think the confusion originated from the name of the TEST_PACE_OUT pins. They are actually inputs for an externally driven test signal and outputs for the pace detection feature on the ADS1294. In any case you should still be able to use them to see the internally generated test signal using the method i described.

    Brian

  • Hi Brian,

    Thanks for your reply. We have tried with the suggested configuration but it gives the same output.
    Unable to capture square wave signal on the mentioned paceout pin TEST_PACE_OUT2.


    Test signal on Channel 1.
    Ch2,Ch3,Ch4 inputs are shorted
    Progrmmed with the Gain =1 also

    writeReg(0x15, 0x01); // Pace Detect Register (address = 15h) (reset = 00h)
    writeReg(0x05, 0x65); // Test signal
    writeReg(0x06, 0x61); // Input shorted
    writeReg(0x07, 0x61); // Input shorted
    writeReg(0x08, 0x61); // Input shorted

    Please kindly help us in this.


    Thanks & Regards,
    Jagdish B
  • Jagdish,

    Looking at your scope snapshot above of the interface, it looks as though this data corresponds to the first byte of the status word. Each sample will be preceded by a 24-bit data word that begins with 0xC0. The data will look like the following:

    24-bit status | 24-bit channel 1 data | 24-bit channel 2 data | 24-bit channel 3 data | 24-bit channel 4 data

    Are you reading the full 120 bits of data with each sample? Is the START pin being left high constantly? Could you capture the raw data in a file and send it to me?

    Brian
  • Brian,

    Thanks for your reply. We are reading only Channel -1 data because other channels are being shorted ( So,Ch2,Ch3,Ch4 data becomes zero)

    We are able to read status register correctly for each frame.( 3 bytes of status Reg+ 3 bytes of Ch-1 data = 6 bytes )

    The Channel-I output gives the unwanted signal instead of square wave data.

    Please find the raw data file attached to this threadrawdata_file.txt.

    Thanks & Regards,

    Jagadish B

    Jagadish 

  • Hello Jagadish,

    What is obtained when you read data from the shorted input channels? It should appear as Gaussian noise.

    Brian
  • Hello Brian,

    We programmed the hardware based on Initial flow at powerup  of data sheet (Fig.93)

    Here I am attaching two output files.

    Start pin is tied to HIGH

    1.Noise.out.txt - When all channels inputs are shorted.test_out.txtNoise_out.txt

    2.test_out.txt-  When channel 4 is applied as a test signal, CH-1,CH-2,CH-3 are shorted

    test_out.txt

    Each row contains a frame of 120 bits( 15 bytes). 

    24-bit status | 24-bit channel 1 data | 24-bit channel 2 data | 24-bit channel 3 data | 24-bit channel 4 data.

    Status word register giving correct value in each frame.

    The Channel 4 output is not giving proper output.Please kindly help us in this regard 

    Please kindly help us 

    Thanks & Regards,

    Jags

  • Jags,

    None of the results look to be correct. Would it be possible for you to take an oscilloscope screenshot of an entire data word? At least try to capture the first 9 bytes if you can't read the bits from the entire word when you capture it.

    Brian