Read from SPI - ADS1292R

Hi Folks.

I am having some trouble with SPI communication. I am using an UNO to talk to a ADS1292R ECG/Respiration Breakout Kit.

The code was provided from the following website.

https://github.com/Protocentral/ADS1292R_shield/tree/master/Arduino/libraries/ads1292r

It works (I think) by sending commands to the ADS1292R via SPI and then fills up a buffer in response. However there is no SPI read type of function anywhere in the code but yet the DataPacketHeader is supposed to sent to serial port.

Serial.print(DataPacketHeader*); etc..*
When viewed on the serial monitor it is clearly junk.
Can anybody advise on how to read from the device???
Thanks,
Mark.

If your using the example code supplied in the github link then it does not seem to have a Serial.begin() in setup(). Maybe that's the problem.

EDIT:
It seems to be part of the library code instead for some reason.

Serial.begin(57600);

So ensure the serial monitors baud rate is set to same speed of 57600

I have tried that and it has not changed. I also put in a Serial.println("Hello"); which was printing fine but the data array is not.

Does the received SPI data have to be converted or anything?

Don't have Arduino at work to test this but maybe putting ,DEC (or ,HEX) in the serial print commands will cast it to the output type you need.

 if(SPI_RX_Buff_Count > 135)
  {   
     for(i = 0; i < 5; i++)
     {
       Serial.print(DataPacketHeader[i],DEC);
     }
     for(i = 0; i < 135; i++)
     {
       Serial.print(SPI_RX_Buff[i],DEC);
     }
     for(i = 0; i < 2; i++)
     {
       Serial.print(DataPacketFooter[i],DEC);
     }
//Serial.println();
     SPI_RX_Buff_Count = 0; 
  }

You may also need a println() at the end to ensure next set of values get dumped on a new line.

Well I'm deffinately getting actual numbers now. Thank you for your help. Now to just make sense of it all.

MarkG123:
Well I'm deffinately getting actual numbers now. Thank you for your help. Now to just make sense of it all.

There is another github link here that seems to be for the same shield/chip that will interface with a free-ware program called BrainBay and further searching yields this link that may help.

Hello

I am working on the AD1292R ECG/Respiration kit with Arduino Uno and had same problem of SPI communication. I did everything posted in it. But the output from my arduino uno is till the same. The serial monitor shows dummy values as shown in the image below. I have also uploaded the code i have loaded in my arduino uno. Hope to get reply soon.

ex1.ino (1.74 KB)

dummyvaluehelp.doc (188 KB)

FYI,

The output you are seeing in the terminal is not junk, it is the ASCII value (sending as character) sending to the gui.
if you want to see the values in terminal, print those as integer from the code and disable all ASCII data.