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.

ADS1299EEGFE-PDK: ADS1299 always read zeros from SPI (Arduino UNO)

Part Number: ADS1299EEGFE-PDK
Other Parts Discussed in Thread: ADS1299

Hello everyone!

I'm currently working on a BCI application using the ADS1299EEGFE-PDK to acquire the EEG signals. In my current setup I'm using an Arduino UNO to interface with the Daughter card via SPI, while the MMB0 is used only as a power supply.

The GPIO pins are connected as follows (the jumpers on the daughter card are left in default settings)

----------------------------------------------------------------------

             Arduino UNO    <---->    ADS1299

  • SCLK [pin 13]    <---->    CLK     [J3.3]
  • MISO [pin 12]    <---->    DOUT  [J3.13]
  • MOSI [pin 11]    <---->    DIN      [J3.11]
  • SS     [pin 10]    <---->    CS        [J3.7]
  • DRDY [pin 9]     <---->    DRDY  [J3.15]
  • GND  [pin 14]    <---->    GND    [J3.4]

----------------------------------------------------------------------

The sketch I'm using is an example from the library ADS1299 for Arduino which should read and write to some registers:

#include <ADS1299.h>

ADS1299 ADS;

//Arduino Uno - Pin Assignments; Need to use ICSP for later AVR boards
// SCK = 13
// MISO [DOUT] = 12
// MOSI [DIN] = 11
// CS = 10; 
// DRDY = 9;

//  0x## -> Arduino Hexadecimal Format
//  0b## -> Arduino Binary Format

boolean deviceIDReturned = false;
boolean startedLogging = false;

void setup() {

  Serial.begin(115200);
  Serial.println();
  Serial.println("ADS1299-bridge has started!");
  
  ADS.setup(9, 10); // (DRDY pin, CS pin);
  delay(10);  //delay to ensure connection
  
  ADS.RESET();
}

void loop(){
  
  if(deviceIDReturned == false){
    
    ADS.getDeviceID(); //Funciton to return Device ID
    
    //prints dashed line to separate serial print sections
    Serial.println("----------------------------------------------");
    
    //Read ADS1299 Register at address 0x00 (see Datasheet pg. 35 for more info on SPI commands)
    ADS.RREG(0x00);
    Serial.println("----------------------------------------------");
    
    //PRINT ALL REGISTERS... Read 0x17 addresses starting from address 0x00 (these numbers can be replaced by binary or integer values)
    ADS.RREG(0x00, 0x17);
    Serial.println("----------------------------------------------");
    
    //Write register command (see Datasheet pg. 38 for more info about WREG)
    ADS.WREG(CONFIG1, 0b11010110);
    Serial.println("----------------------------------------------");
    
    //Repeat PRINT ALL REGISTERS to verify that WREG changed the CONFIG1 register
    ADS.RREG(0x00, 0x17);
    Serial.println("----------------------------------------------");
    
    //Start data conversions command
    ADS.START(); //must start before reading data continuous
    deviceIDReturned = true;
  }
  
  //print data to the serial console for only the 1st 10seconds of 
  while(millis()<10000){
    if(startedLogging == false){
      Serial.print("Millis: "); //this is to see at what time the data starts printing to check for timing accuracy (default sample rate is 250 sample/second)
      Serial.println(millis());
      startedLogging = true;
    }
    
    //Print Read Data Continuous (RDATAC) to Ardiuno serial monitor... 
    //The timing of this method is not perfect yet. Some data is getting lost 
    //and I believe its due to the serial monitor taking too much time to print data and not being ready to recieve to packets
    ADS.updateData();  
  }
  
  
}

Which returned the following output in the serial monitor:

 
ADS1299-bridge has started!
0
----------------------------------------------
ID, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
----------------------------------------------
ID, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG1, 0x01, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG2, 0x02, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG3, 0x03, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF, 0x04, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH1SET, 0x05, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH2SET, 0x06, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH3SET, 0x07, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH4SET, 0x08, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH5SET, 0x09, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH6SET, 0x0A, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH7SET, 0x0B, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH8SET, 0x0C, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
BIAS_SENSP, 0x0D, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
BIAS_SENSN, 0x0E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_SENSP, 0x0F, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_SENSN, 0x10, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_FLIP, 0x11, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_STATP, 0x12, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_STATN, 0x13, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
GPIO, 0x14, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
MISC1, 0x15, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
MISC2, 0x16, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG4, 0x17, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
----------------------------------------------
Register 0x1 modified.
----------------------------------------------
ID, 0x00, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG1, 0x01, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG2, 0x02, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG3, 0x03, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF, 0x04, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH1SET, 0x05, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH2SET, 0x06, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH3SET, 0x07, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH4SET, 0x08, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH5SET, 0x09, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH6SET, 0x0A, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH7SET, 0x0B, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CH8SET, 0x0C, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
BIAS_SENSP, 0x0D, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
BIAS_SENSN, 0x0E, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_SENSP, 0x0F, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_SENSN, 0x10, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_FLIP, 0x11, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_STATP, 0x12, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
LOFF_STATN, 0x13, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
GPIO, 0x14, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
MISC1, 0x15, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
MISC2, 0x16, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
CONFIG4, 0x17, 0x00, 0, 0, 0, 0, 0, 0, 0, 0
----------------------------------------------
Millis: 224

Unfortunately the data retrieved via SPI have all been zeros in all registers, and after going through all threads I could find on this topic, none seemed to help. At the current moment I don't have access to a logic analyzer or probing equipment, I just hope the error is due to a newbie mistake in the hardware connections I made.

I will be very grateful for any suggestion you could give me!

L.G.

  • Update:

    I thought this issue could have been related to SPI communication, but after I manage to install windows 7 to run the ADS1299EEG-FE evaluation software (intended for the use of the board), the register map returned (after quite some time) by the software was, once again, filled with zeros.

    At this point I find myself having a really big issue, since my entire work of thesis relies on the use of this kit... 

  • Hi Lorenzo,

    Can you please check a few items below when you are using the ADS1299EEG-FE EVM?

    • Is the driver installed properly on the PC? You should see the USBStyx under the libusb-win32 devices in the Device Manager when you connect the USB to the ADS1299EEG-FE eval board.

    • If the driver is installed properly, you should be able to read the default registers value from the ADS1299EFG-FE evaluation software (ADC Register -> Register Map). Please see the attached picture below for what you should see if both hardware and software are working properly. 

    Please let me know if you are able to get the ADS1299EEG-FE evaluation EVM to work with the evaluation software.

    We will not be able to help with the Arduino UNO hardware or software. You may find some related posts below for interfacing the ADS1299 to the Arduino hardware. Please refer to Figure 67 of the datasheet for the initial flow at power-up when you are interfacing the ADS1299 to the Arduino HW. 

    https://e2e.ti.com/support/data-converters/f/73/t/787501

    The step by step debugging method in the ADS129x BIOFAQ will be helpful to get the device in the correct operation condition (see direct link below).

    How do I verify that my ADS129x device is still functional?

    Thanks.

    -TC

  • Hi, thank you very much for responding!

    1) I verified the presence of the driver and everything is up to date;

    2) I manage to get the software to display the register map, although it took a really long time to complete the reading (an average of 10 minutes) and after the progress bar reaches 100% the registers appear to contain all zero values (even the ID register). I will attach a screenshot of what it looks like:

    3) Jumpers configuration of the daughter board is the default one, I will attach a photo of the board as well:

    Thank you again for taking the time to look into this, if there is anything else I could provide let me know.

  • Hi Lorenzo,

    Are you planning to use external CLK to the device from JP13-17? The EVM picture shows you are setting JP18 to Pos 1-2 which needs external CLK from JP3-17 instead of using oscillator on the EVM board. Please refer to Sectio 4.2 on the user guide for the clock configuration. Can you please switch JP18 to Pos 2-3 and see if you can read all the default registers? 

    Thanks.

    -TC

  • Thank you sir for your last tip! Didn't actually notice the jumper was out of place, I did check but probably I got confused with the pin enumeration. This explains also the long waiting for register reading, the clock pulse was completely missing. The intended setup was to have the Ads1299 with its own clock and just to interface a microcontroller via SPI with it.

    Now I can read properly and consistently all the registers, as I will show you with the screenshot below:

  • Hi Lorenzo,

    Glad to hear you are able to get your EVM working.

    Thanks.

    -TC