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.
I am using an SPI connection between the ADS1298 and an arduino UNO. I am able to read the devices´s ID but i want to read the register of the ECG stored in the ADS1298.
I am new in the programming world and I do not really understan how to read the registers.
If someone could give me a brief explanation that could help me understand the registers and how to access them i would really appreciate it.
Thank you,
Miguel
Hi Miguel,
Welcome to our forum and thank you for your post!
First, can you clarify whether you want to read the device register settings or the ADC output data? I'm asking because I wanted to clarify that our data is not read from registers - instead, the data is automatically loaded into an output shift register when available. All you have to do is enable the interface (/CS = low) and send SCLKs to the device in order to shift the data out.
To read the registers in the ADS1298, you will need to send two bytes as described in section 9.5.2.10. There is a minimum time requirement that the two bytes must occupy (tSDECODE). If your SCLK is too fast, the device may not recognize the command. You can tell me your SCLK frequency and I will help you check this spec.
After the RREG command is sent, the following SCLKs will shift out the register contents, starting at the specified address.
Best Regards,
Hello Ryan,
First of all thank you very much for replying me. I was reading the datasheet and realized that you are right. I am trying to retrieve the data from the ADS1298 and as I said did not have a very good understanding of the device. As you ask me I want to read the ADC output data. Following your recommendation i enabled the interface but i do not know what you mean about sending SCLKs.
I am sorry that this may be a dumb question but It is my first time using arduino and some of the commands or literature are unknowns for me.
Thank you
Miguel
Hi Miguel,
Glad to help!
"Send SCLKs" simply means that you need to toggle the SCLK pin. SCLK is the clock signal for the SPI interface. Data is shifted into / out of the ADC on the SCLK rising edge and latched or "read" on the falling edge. This corresponds to a "clock polarity" (CPOL) of 0 and a "clock phase" (CPHA) of 1.
Best Regards,
Hi Ryan,
I did what you told me and tried to send SCLKs but i realized that I was making a mistake, or I think is a mistake.
I am using an oscilloscope to see how is the behavior of the DRDY, in the datasheet is specified that wen the DRDY goes down is when I am able to read the data (or that is what I think I understand), and after watching the oscilloscope i only see that the DRDY goes up but it never goes down. I tried to use a function called attachInterrupt to see if the DRDY goes low at some point but it appears that it does not do it.
Do you know why is that happening? I tried disconnecting and connecting everything again to see if I was miss connecting something but it didn´t work.
Thank you
Miguel
Hello Alex,
Thank you very much, i read section 10 of the datasheet and it was very helpful. Also I am able to see the pulsing behavior of the DRDY as you mentioned, I was making a mistake at the moment of defining the pins and now I am able to obtain with the oscilloscope the normal and expected behavior.
Thank you
Best Regards
Miguel