# Read from SPI - ADS1292R

**URL:** <https://forum.arduino.cc/t/read-from-spi-ads1292r/304763>\
**Category:** Programming\
**Created:** [April 14, 2015, 2:54pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763 "2015-04-14T14:54:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkG123](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MarkG123](https://forum.arduino.cc/u/MarkG123)\
**Post date:** [April 14, 2015, 2:54pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/1 "2015-04-14T14:54:43Z")

</div>

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](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._

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [April 14, 2015, 3:09pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/2 "2015-04-14T15:09:11Z")

</div>

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.

```cpp
Serial.begin(57600);

```

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

---

<div class="post-metadata">

**Author:** ![MarkG123](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MarkG123](https://forum.arduino.cc/u/MarkG123)\
**Post date:** [April 14, 2015, 3:21pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/3 "2015-04-14T15:21:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [April 14, 2015, 3:52pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/4 "2015-04-14T15:52:48Z")

</div>

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.

```cpp
 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.

---

<div class="post-metadata">

**Author:** ![MarkG123](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MarkG123](https://forum.arduino.cc/u/MarkG123)\
**Post date:** [April 14, 2015, 4:04pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/5 "2015-04-14T16:04:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [April 14, 2015, 4:23pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/6 "2015-04-14T16:23:15Z")

</div>

> 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](https://github.com/Protocentral/ads_1292r_breakout_brainbay) that seems to be for the same shield/chip that will interface with a free-ware program called [BrainBay](http://www.shifz.org/brainbay/) and further searching yields [this](http://www.protocentral.com/blog/getting-started-with-ads1292r-ecgrespiration-shield-n9) link that may help.

---

<div class="post-metadata">

**Author:** ![aka\_jot](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@aka\_jot](https://forum.arduino.cc/u/aka_jot)\
**Post date:** [August 7, 2015, 9:48am UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/7 "2015-08-07T09:48:08Z")

</div>

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](https://forum.arduino.cc/uploads/short-url/9awCfr6ytg1jpRdze0NAEOLfuQN.ino) (1.74 KB)

[dummyvaluehelp.doc](https://forum.arduino.cc/uploads/short-url/hknX8k6OKw7bEojJBlGMriEpijX.doc) (188 KB)

---

<div class="post-metadata">

**Author:** ![JOICETM](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@JOICETM](https://forum.arduino.cc/u/JOICETM)\
**Post date:** [June 6, 2019, 6:41am UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/8 "2019-06-06T06:41:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 9:14pm UTC](https://forum.arduino.cc/t/read-from-spi-ads1292r/304763/9 "2021-05-05T21:14:11Z")

</div>

Closed on May 5, 2021, 9:14pm UTC


