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.

ADS1298ECGFE-PDK: Getting Spikes in Between Data which capturing data with MCU

Part Number: ADS1298ECGFE-PDK
Other Parts Discussed in Thread: ADS1298

Tool/software:

Hi,

I am using NRF52840 to capturing ADS1298 data, I am able to achieve Pure sine wave using it mmb0 evolution board, but when i use nrf52840 i am able to get data with a lot of noise like some nano second, High frequency spikes in between data. I have check SPI configuration as well as all ground connections. Does in Ti Provided firmware for ads1298ecgfe-pdk  having a filters which is removing noise or spikes from that? If yes can you please provide me it's path? Or is there any kind of filters in that firmware which filters data?

Can you please help me to solve this problem? 

below i have provided image of my captured data over BLE, Please have a look.

  • Hello Ajay,

    This data does not look to be from the analog signal itself. Rather, this appears to be an SPI data transfer issue. Most likely, the SPI communication frames are overlapping the next nDRDY falling edge, so the conversion results are getting corrupted. This is because the output shift register is automatically updated with the latest conversion data in RDATAC mode.

    I suggest to review the SPI timing when communicating with the NRF52840. 

    Regards,

    Ryan

  • Hi Ryan,
    Thank you for your reply,

    I am Collecting data at 16,000 SPS and Proving 1Khz sine wave as Input, Below is my SPI configurations i have done please verify

    SPI_Frequency 8Mbps,
    SPI_MODE_1,
    SPI_BIT_ORDER_MSB_FIRST

    SPI 8Mbps speed is enough for transmitting this data. 

  • And Yes,
     

    I found that MMB0 evolution board which comes with ADS1298 is carring FFT,FIR and IIR filters. So that's why we are able to get fine signal at output while using EVK Kit?

  • Hi Ryan,

    Today i Captured data over USB before sending it to BLE. I have configured channel register (0x05), I have set it to Input Shorted and Set gain of 1 (0x11 ). 
    If the input is grounded so we get 0 at output But i have detected some noise over there, Then i captured that data over BLE and observed same issue, As shown in Below image. Does this noise is introducing from ADS1298?

      

  • Hello Ajay,

    Please excuse my absence while I was out of office.

    The filters in the MMB0 are not required for removing the artifacts observed in your output data. The raw ADC codes would not contain these spikes if collected properly and plotted without any additional filtering. This issue is likely due to SPI timing.

    Are you monitoring for the nDRDY falling edge to begin reading data? Are you completing the 216-bit frame before the next nDRDY falling edge?

    One suggestion I have is to modify your code to use RDATA mode instead of RDATAC. This would involve two changes:

    1. Send the SDATAC command (11h) once before beginning your data collection routine. If you have already sent this command prior to configuring the device registers, then you can consider this step completed.
    2. In your data collection routine, send the RDATA command (12h) to read data on demand. The RDATA command is then followed by 216 bits of 0b to read the entire SPI frame.

    Using the RDATA command will prevent the output shift register from updating with new conversion data while the current data is read. You can leave the inputs configured as input-short for this test and all values should be within the typical noise spread.

    Regards,

    Ryan

  • Hi Ryan,

    Thank-you for replying,
    As per your suggestion i am reading data on RDATA(0x12) and using this i am able to get clear data without spikes, but the data is shifted towards positive, as shown in image below.

    Can you please tell me why signal is shifting?
    I have observed on EVK kit also there also the data is shifted towards positive and when i grounded WCT input pin then i am able to get proper output (Pos/Neg both). But same on nrf52840 I am grounding WCT input pin then i am getting different output, As shown in image below.

    So can you please guide me through this?

  • Hello Ajay,

    Glad to hear the SPI issues are resolved.

    Can you please mark up a schematic to illustrate how the input sine wave is applied to the ADS1298 inputs? 

    WCT is an output pin derived from the average of up to 3 input electrodes. Typically this is used as the negative input for the V1-V6 channels. Assuming the INxP and INxN have approximately the same common-mode voltage (i.e. same DC bias), the differential ADC output should remain centered around 0, which is mid-scale for a bipolar ADC transfer function.

    Regards,

    Ryan

  • Hi Ryan,

    As you said WCT is Negative input pin for V1-V6 Channels. So we are connected ground at WCT and applying sine wave input at INxP(V6 = Ch1). You can see Below image I have tried to explain our input applying sequence through schematic.

    When we do this same connections with EVK kit we are able to capture sine wave from the base level zero, but when we apply same connections with our MCU board we have captured this:

    But when we short WCT Pin and Read data, we get the Sine wave with shifting with EVK kit and MCU board as well. As shown in below image.

    And when we collect data with RDATAC command we are able get noisy data with the base line zero. But with RDATA Command noise is removed but the data is shifted.
    Please help me figure it out.

  • Hello Ajay,

    The results collected via RDATAC mode vs. RDATA mode should be exactly the same with no shift to the DC level of the converted waveform. This tells me that you are either not capturing or not parsing the data correctly.

    As you said WCT is Negative input pin for V1-V6 Channels. So we are connected ground at WCT and applying sine wave input at INxP(V6 = Ch1). You can see Below image I have tried to explain our input applying sequence through schematic.

    When we do this same connections with EVK kit we are able to capture sine wave from the base level zero

    Thank you for marking the connections on the schematic. This makes the test setup clear. If the left side of JP16 is connected to GND, and the captured sine wave is centered around zero at the output, this tells me that the sine wave applied to IN1P also had an offset or common-mode voltage = GND. Is that correct? 

    A few remaining doubts:

    1. Please remind me whether you are using unipolar or bipolar analog supply voltages.
    2. Is GND of the PCB shared with GND of the sine wave function generator?
    3. When JP16 is shorted, how are the WCT amplifiers configured? Can you measure the WCT pin voltage? Please share the complete register map configuration for these tests.
    4. The peak-to-peak codes in the figure below is about 10,000, whereas the output from your MCU board (COM9) are close to 60,000. What is the input signal amplitude? Are you using the same input amplitude and PGA gain settings on both setups?

      Regards,

      Ryan

  • Hi Ryan,

    When we use RDATAC and short the input to ground the we are able to get a straight line centred to zero with noise. But when we do same with RDATA we get shifted data.

    and here are Answers of your Doughts,
    1. We are giving Bipolar analog Supply as shown in below image.


    2. Yes we are Connecting Ground of PCB with our Function generator's Ground.

    3. When JP16 is shorted the voltage at WCT pin is -2.4V and the register configuration are listed below
    conf|config1    0x01 0xC1
    conf|config2    0x02 0x10
    conf|config3    0x03 0xFC
    conf|loff           0x04 0x03
    conf|ch1set     0x05 0x10
    conf|ch2set     0x06 0x80
    conf|ch3set     0x07 0x80
    conf|ch4set     0x08 0x80
    conf|ch5set     0x09 0x80
    conf|ch6set     0x0A 0x80
    conf|ch7set     0x0B 0x80
    conf|ch8set     0x0C 0x80
    conf|rldsensp  0x0D 0xFF
    conf|rldsensn  0x0E 0xFF
    conf|loffsensp 0x0F 0xFF
    conf|loffsensn 0x10 0x02
    conf|loffflip      0x11 0x00
    conf|gpio        0x14 0x00
    conf|pace       0x15 0x00
    conf|resp        0x16 0xF0
    conf|config4   0x17 0x22
    conf|wct1       0x18 0x0A
    conf|wct2       0x19 0xE3

    4. The Amplitude is 500mV, 1Khz freq and Gain is of 1 in both setups.

  • Hello Ajay,

    Please make the following register setting adjustments:

    • Unused channels (2-8) set CHnSET to 0x81
    • RLD_SENSP and RLD_SENSN = 0x00
    • LOFF_SENSP and LOFF_SENSN = 0x00
    • RESP = 0x00
    • CONFIG4 = 0x00
    • WCT1 and WCT2 = 0x00

    Leave JP16 open as WCT function is not currently being used. Connect the sine wave input to JP33[4]. Connect GND to JP33[2].

    With AVDD = +2.5V and AVSS = -2.5V, you can apply your 500mVp sine wave with DC offset = GND as your IN1P input signal. The ADC output should be centered near 00h and the amplitude in codes should directly correlate to the input amplitude based on the LSB size (2*4V / 2^24) = 477 nV/code.

    For now, please continue using RDATA mode and share the results. If needed, you can send the raw ADC data in a CSV file.

    Regards,

    Ryan

  • Hi Ryan,

    As you said i had configured all this registers and applied input as specified, still i am not able to achieve data. I have attached Raw Data file you can plot graph and view the output of ADS.

    raw_data.csv
    And Ryan can you please explain me what you are trying to explain me through this point (The ADC output should be centered near 00h and the amplitude in codes should directly correlate to the input amplitude based on the LSB size (2*4V / 2^24) = 477 nV/code).

    Thanks for your Reply.

  • Hi Ryan,

    we have cut the pick to pick samples of current output and place it in a single image, As you can see in below image we are getting right data but shifted. Please verify and suggest some solution to solve this kind of problem. Is this problem comes due to register configurations?

  • Hi Ajay,

    And Ryan can you please explain me what you are trying to explain me through this point (The ADC output should be centered near 00h and the amplitude in codes should directly correlate to the input amplitude based on the LSB size (2*4V / 2^24) = 477 nV/code).

    00h is the middle of the ADC transfer function, which ranges from 800000h to 7FFFFFh.

    Do you think there is a mistake in the binary to decimal conversion? You've sent me the raw data, but it is already converted to decimal so I cannot confirm if it was converted correctly.

    I did a quick calculation to check the magnitude of the DC shift and the amplitude of the clean sine wave output. The middle code appears to be around 1.075e6. At 477nV LSB size, this equates to approximately 513 mV of offset. This value is much greater than expected when applying a sine wave directly to the channel inputs with PGA gain set to 1V/V. Can you please share an oscilloscope capture of both IN1P and IN1N with DC-coupled probes? 

    The same analysis can be done for the amplitude. 10,000 codes peak-to-peak equals approximately 4.8mVpp. However, you are applying a 1Vpp sine wave. I believe something is incorrect in your binary to decimal conversion.

    Regards,

    Ryan

  • Hi Ryan,

    As you said, there is something wrong in data conversion so i have recheck my data conversion functions. I had found something, As according to data sheet the Output reading format is like this( status register(3 Byte) + 8 Channel (Each one of 3 Byte) = 27 Bytes) Right? As shown in image below.

    So we are reading data and storing it in 27 byte buffer using Ch-2, So data must be stored like this Status-Register(Array[0,1,2])+CH_Reg[Array[Ch-1[3,4,5],Ch-2[6,7,8],Ch-3[9,10,11]------And So on];

    When we use RDATAC Command we are able to achieve data in this manner, but when we use RDATA command one extra byte is added in this format, I have tried to explain it through image attached below, I am not able to find something like this in data sheet, can you verify it and tell me why it adding one extra byte?

    As you see in above image we are getting some data in Array[7,8,9] insted of Array[6,7,8]. You can observe Zero Before Status Register i have marked. After this i have collected data through Array[7,8,9], So now my graph is generating with the offset zero. I am sharing Raw data file without converting to decimal. First four byte of every data is frame index and remaining 240 bytes carrying data.
    log_file_in_hex.txt

    I have one more query, When we are connecting ADS1298 with nrf52840 controller and applying 1V input with the PGA-1 so my output should be near to 1V, But my output is generating around 500mV Half of input And when i set PGA-2 then my output should be double of applied input but my output is around 1V at the PGA-2.

    This is my output with the PGA-2 using RDATA Command

  • Hello Ajay,

    I'm glad you have figured out the issue!

    RDATAC mode does not require an SPI command to load the data since it happens automatically. Therefore, only 216 SCLKs are required to retrieve all the data. The first SCLK immediately clocks out the beginning of the STATUS word.

    In RDATA mode, data is loaded only when the device receives the RDATA SPI command (12h). When the host sends the 8-bit command on DIN, the device will clock out 8 bits on DOUT. These first 8 bits must be ignored by the host. After the RDATA command is latched, the next bit on DOUT will be the beginning of the STATUS word.

    The amplitude seems correct. Remember that the ADC is converting the differential voltage at the inputs. So if INxN is constant, and you apply a sine wave with amplitude A to INxP, the differential voltage seen by the ADC will swing from -A to +A (times gain, if > 1).

    At Gain = 2, 1 LSB = (2*VREF / Gain / 2^n) = (2*4) / 2 / 2^24 = 238.42 nV. The peak of the output sine wave in your last output plot is close to 4,000,000, which equates to 0.954 Vp.

    Regards,

    Ryan

  • I should remind you that it is possible to miss a sample when using RDATA mode. This can happen when the data read frame overlaps the next conversion. If possible, it's best practice to monitor the nDRDY interrupt and read the entire 216-bit frame in RDATAC mode before the next interrupt to ensure data is not lost.

    Regards,

    Ryan

  • Hi Ryan,

    Thank you for explaining me the reason of that extra bit. But still i am not able to understand the logic of Gain. I am sharing you some files from my observation, please check below

    Input Applied +/- 500mV:


    Output Captured from EVK Kit with the PGA Gain of 1:

    As you can see peak output of result is around 500mV.

    Output Captured from EVK Kit with the PGA Gain of 2:


    As you can see in the above image when i have set the PGA gain at 2 then my peak output get double of applied input around 1V.

    Output Collected with external Micro controller with PGA gain of 1:


    When we collect data at PGA Gain of 1 (With External Micro controller) we captured only peak value around 250mV, Half of applied input. I have attached Raw data file you can go through it. 

    Raw Data file of output (when connecting with external micro controller):

    raw_data_file.txt
    Why this problem happen with external micro controller and not with EVK kit? Can you please explain me and suggest some solution?

  • Hello Ajay,

    When we collect data at PGA Gain of 1 (With External Micro controller) we captured only peak value around 250mV, Half of applied input. I have attached Raw data file you can go through it. 

    The peak amplitude in this waveform is approximately 1e6 codes, which is close to 477 mVp, not 250 mV. Please review your calculations of codes to volts based on the LSB size.

    The ADC output should be centered near 00h and the amplitude in codes should directly correlate to the input amplitude based on the LSB size (2*4V / 2^24) = 477 nV/code.

    Regards,

    Ryan

  • Hello Ryan,

    Thank-you for suggestion, There was problem in my calculation. I have changed the calculation can you please verify the calculation i am attaching one excel file, every-thing is listed inside.
    Data Captured on 31st Aug 2024.xlsx 
    And thank-you for helping us.

  • Hello Ajay,

    Yes, the conversion looks correct. Pleasure to help and I'm glad it is working now.

    Regards,

    Ryan