I am facing an issue with ADS1299.
I have programmed ADS1299 channels to internal test signals in CHnSET register. It is showing square wave on Serial Plotter on Arduino IDE, as it should as per the datasheet.
When I changed the MUX[2:0] value in CHnSET to 000, for external signal routing. I am getting some noise when I place my fingers, I thought it is working fine as human body has some static electrical charge.
But when I applied a sine wave of 5uV VPP from a function generator, it showed the same waveform as earlier when there was no signal. Shown in the image below.
I have applied the signal between IN8P and IN8N. BIASOUT pin left open. When BIASOUT pin connected to IN8N, as the datasheet says it is driven ground for voltage reference, the waveform shown by EEG is the same as above, no matter whatever waveform I give as input.
The registers I have set are as follows:
ads_init(){ ads_hardReset(); //Hardware reset by RESET pin ads_softReset(); // Send reset command getDeviceID(); // get device id ads_wreg(CONFIG1, 0xD6); // No Daisy, Osc. Clock output disabled, 250Hz ads_wreg(CONFIG2, 0XD5); // Generate test signal externally ads_wreg(CONFIG3, 0xEC); // Internal ref buff enabled,bias measurment open ads_wreg(CONFIG4, 0X00); // Continuous conversion mode, Leadoff comparator OFF //Only measuring from channel 8 ads_wreg(CH1SET, 0xC1); // POWER DOWN ads_wreg(CH2SET, 0xC1); // POWER DOWN ads_wreg(CH3SET, 0xC1); // POWER DOWN ads_wreg(CH4SET, 0xC1); // POWER DOWN ads_wreg(CH5SET, 0xC1); // POWER DOWN ads_wreg(CH6SET, 0xC1); // POWER DOWN ads_wreg(CH7SET, 0xC1); // POWER DOWN ads_wreg(CH8SET, 0x00); // init channel with normal eletrode, 1X gain, SRB2 open ads_wreg(BIAS_SENSP, 0X80); //Switch ON for ch8 ads_wreg(BIAS_SENSN, 0X80); //Switch ON for ch8 ads_wreg(MISC1, 0X20); //Connect SRB1 to all INxN of channel ads_command(_START); // Start ads conversion delay(1); ads_command(_RDATAC); // Start continuous conversion mode } //Function used to get data from ADS1299: global long output[8]=0; void getADSdata() { long dataPacket = 0; vspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE1)); digitalWrite(ADS_CS, LOW); //Low to communicated for(int i = 0; i<3; i++){ byte dataByte = vspi->transfer(0x00); statusData = (dataPacket<<8) | dataByte; } for(int i = 0; i<8; i++){ for(int j = 0; j<3; j++){ byte dataByte = vspi->transfer(0x00); dataPacket = (dataPacket<<8) | dataByte; } output[i] = dataPacket; dataPacket = 0; } digitalWrite(ADS_CS, HIGH); vspi->endTransaction(); Serial.println(output[7]); //Print Ch8 data and plot. }
For the following situation, I want to ask few questions:
1. Is the code correct while initialising registers? and getting data?
2. How should I connect IN8P, IN8N, BIASOUT, AGND (if it has to be connected for ground reference), wires to electrodes and gather EEG signals.
Thanks