I still have a problem to read and processing the ECG signal from ads1298.
My schematic has a bipolar power supply, where AVDD is +3.3v, DVDD +2.5v, AVSS is -2.5v and GND.
SPI works fine and I can read chipID and read my registers back when I set them. (Also logic analyzer confirms it)
Each my channel has a RC low-pass filter (4.7kOhms and 1000pF), then cut-off frequency is 33.8kHz.
I try to use single lead mode, so I connected the first electrode to 1P and the second to 1N, I didn't use RLD electrode. All other 7 pairs of electrodes and RLD are not connected.
write_byte(CONFIG1, 0x80 | 0x04 | 0x02); // enable 8kHz sample-rate write_byte(CONFIG2, 0x10); write_byte(CONFIG3, 0x08 | 0x04 | 0x80 | 0x20 | 0x40); write_byte(CONFIG4, 0x02); write_byte(RLD_SENSP, 0x00); write_byte(RLD_SENSN, 0x00); write_byte(LOFF_SENSP, 0xFF); write_byte(LOFF_SENSN, 0x02); write_byte(LOFF_FLIP, 0x00); write_byte(LOFF_STATP, 0x00); write_byte(LOFF_STATN, 0x03); write_byte(GPIO, 0x00); write_byte(PACE, 0x00); write_byte(WCT1, 0x08); write_byte(WCT2, 0x00);
And read data when my DRDY is toggled
int ch = 1; for (int i=3*ch; i<3*ch+3; i++) // miss the first 3 bytes of header { NRF_LOG_INTERNAL_RAW_INFO("%d\r\n", out[i]); // out is my data }
I wrote a simple code in Processing which gets the serial data and draws the chart
When I put my 2 electrodes on my right and left wrists I get this image
When I put off these 2 electrodes I can see this one
My sample rate is 250 SPS, also I saved my output data to file for processing it in MATLAB using Butterworth low-pass filter of 3rd order.
sig = load('ecg.txt'); Fs = 250; % the sample rate frequency of my ads1298 Fc = 50; % cut-off frequency of 50Hz [b,a] = butter(3,Fc/(Fs/2), 'low'); % the 3rd order of filter freqz(b,a); LPF = filter(b,a, sig); plot(LPF);
But I see not I expected, there is no clear peaks and PQ segments