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.

ADS1292R: How can i proceed to convert it to ecg signal and plot it into matlab?

Part Number: ADS1292R

Hello fellows,

with a following code, I print to SDcard *.txt file a raw data format....


   while (!feof(fp)) {
            fread(&rawData, sizeof(ads1292OutputValues), 1, fp);

            printf("id: %d, val[8]: %08x, %08x, %08x, %08x, %08x, %08x, %08x, %08x, %d, %08x, %.6f[v], %.6fºC, %02d, %02d-%02d-%04d : %02d:%02d:%02d\n",
                rawData.id, 
                rawData.sDaqVals[0], rawData.sDaqVals[1], rawData.sDaqVals[2], rawData.sDaqVals[3], 
                rawData.sDaqVals[4], rawData.sDaqVals[5], rawData.sDaqVals[6], rawData.sDaqVals[7],
                rawData.leadoffDetected, rawData.sresultTempResp,
                rawData.vbattery, rawData.temperature,
                rawData.datetime.dayOfWeek, 
                rawData.datetime.dayOfmonth, rawData.datetime.month, rawData.datetime.year,
                rawData.datetime.hours, rawData.datetime.minutes, rawData.datetime.seconds);
        }

This raw format looks like the bottom example, now I need to convert it in to ECG signal, can someone could help me...

id: 0, val[8]: 00002a36, ffff7fff, 40004c01, 0000aae7, 004a030a, 00007a6f, 00000000, 000084f1, 1, 002a3600, 3.298389[v], 0.000000┬║C, 00, 00-00-0000 : 00:00:00
id: 1, val[8]: 00005bf4, 00197fff, 40004c01, 0000aae7, 004a030a, 00007a6f, 00000000, 000084f1, 1, 005bf400, 3.294360[v], 0.000000┬║C, 00, 00-00-0000 : 00:00:00

Thanks in advance

  • Hi,

    I see you open a similar duplicated thread in 

    https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/1157999/ads1292r-how-can-i-convert-a-raw-data-into-ecg-signal

    I am positing the same questions & suggestions here -

    Hi,

      May I ask what might be the source of your signals? e.g. an ECG simulator or function generator or some random noises?

      Do you happen to have/use the evaluation kit/board(EVM) to do what you are doing?  Are you using an MCU to communicate with the EVM board?

      Have you tried the internal test signals? or injected a known steady voltage signal and understand/observe the results first?

       In the meantime, please take a look of this thread -

    https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/772488/faq-ads129x-how-do-i-convert-adc-output-codes-to-volts/2856893#2856893

    Thanks,

  • Sorry I didn't notice that I had duplicated the topic.

    Yes you can ask and i answer, the source of my signal is the ads1292R, with electrodes acopled in my body, I am using the MSP432 launch pad to communicate with ProtoCentral ADS1292R ECG/Respiration Breakout Kit, yes I already test the internal signals, that output recorded in the SDcard, have more data associated. But I just need to know how  to convert or represent it in one graph. Each sample is represented for one array of eight indexed values, the first six they represent the ecg configuration, the other two represent the led of detection and the respiration signal.
    Can I have some support, I have face a lot of problems with this chip, I have decide made this output and downgrade of the sample rate, to a 125sps, because my microcontroller dont have memory RAM enough.

    Can anyone help me?

  • Hi,

    Although not necessary, but you may want to convert the ADC code from hexdecimal to decimal representation first, then from the decimal ADC code, calculate the input differential voltage. It's suggested to do this with an known signal so you know whether conversion calculation is correct or not.

    Then, after that you can plot those numbers in either excel or matlab or python. 

    By the way, did you verity the data going in and coming out from the SD card? Do they match? It's suggested to verify that first with some known signals first.

    To configure the data rate to 125sps, you can set/configure the following register bits

    8.6.1.2 CONFIG1: Configuration Register 1 (address = 01h)

    Bits[2:0] DR[2:0]: Channel oversampling ratio to 000 IF your (1) fCLK = 512 kHz and CLK_DIV = 0 or fCLK = 2.048 MHz and CLK_DIV = 1.

    Thanks

  • ChienChun Yang, 

    I already have the data configured to 125 spa, I don't need made that configuration, sorry if I don't explain well.

    I have verify the data plated from my microcontroller and the stored in SDcard, they match.

    My dificulty now is :

    val[8]: 00002a36, ffff7fff, 40004c01, 0000aae7, 004a030a, 00007a6f, 00000000, 000084f1, 1, 002a3600

    In this output how , where I have thousands of row  ploted from ADS1292R, like this, how can transform it in a ECG signal

  • Hi,

     It's suggested to bypass the SD card first, i.e. use only MCU to directly communicate with ADS1292R. We are not expert on the SD card you use and don't know how the data streaming/coding/encoding works for the SD card.

      May I ask how many channel's data are you reading? And, are you reading in single shot mode or continuous mode?

     You may have to check your data format/type/representation first or whether your program decode/chop/group the SPI DOUT signal correctly.

     Each channel of ADS1292R is a 24-bit data, so 24-bits are used to represent the signal, so I don't know why you have 8 hex * 4 bits/hex = 32 bits.

      I may suggest you use the internal test signal on only one channel to read(both single shot and continuously) first to verify whether you decode/chop/group the data correctly?

      In the meantime, please take a look of data sheet 9.5.1.4 Data Output Pin (DOUT) and this thread https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/772488/faq-ads129x-how-do-i-convert-adc-output-codes-to-volts/2856893#2856893

      You will need to convert the hex representation to decimal representation first then follow the conversion equations(requires the reference voltage Vref) described above.

    Thanks

  • Hi,
    Since I did not hear back from you, I believe my suggestions answered your questions.
    I will close this post and if you have any pending questions, feel free to post them here or open a new thread.
    Thanks and have a great day!