Hello ,I am unable to get the data from ADS 1298 with Arduino using SPI protocol.
Please help me..
Below I Attached H/W and S/W configuration for this..
ARDUINO CONNECTION WITH ADS 1298 ECGFE BOARD
J3.3 SCLK connected to Arduino pin 13
J3.4 GND connected to Arduino pin GND common.
J3.7 CS complement connected to Arduino pin 10
J3.8 RESET connect to Arduino pin 7 .
J3.11 DIN connected to Arduino pin 11
J3.13 DOUT connected to Arduino pin 12
J3.15 DRDY connected to Arduino pin 3 (programmed)
J4.9 power supply is 3.3V
J4.5 connect to Arduino GND
Software code for ADS 1298 with Arduino UNO.
#include "ads1298.h" #include "adsCMD.h" #include <SPI.h> int gMaxChan = 8; //int gIDval = 0; //int activeSerialPort = 0; //const int kPIN_LED = 13; void setup(){ using namespace ADS1298; pinMode(IPIN_CS, OUTPUT); pinMode(PIN_START, OUTPUT); pinMode(IPIN_DRDY, INPUT); pinMode(IPIN_RESET, OUTPUT); SPI.beginTransaction(SPISettings(16000000, MSBFIRST, SPI_MODE1)); SPI.begin(); //SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV4); //SPI.setDataMode(SPI_MODE1); delay(100); adc_send_command(SDATAC); delay(10); Serial.begin(9600); adc_rreg(0x20); while (Serial.read() >= 0) {} delay(200); } void loop() { long buffer[50]; int incomingByte = 0; static unsigned long tLast = 0; if (Serial.available() > 0) { incomingByte = Serial.read(); } if(millis()-tLast < 500) { tLast = millis(); } unsigned long tStart = millis(); for(int channel = 1; channel <= 8; channel++) { byte value[10]; value[0] = (byte) (buffer[channel]>>8); //value[1] = (byte) (buffer[channel]>>16); //value[2] = (byte) (buffer[channel]>>8); //value[3] = (byte) (buffer[channel]); Serial.println(value[0]); //Serial.println(value[1]); //Serial.println(value[2]); //Serial.println(value[3]); } }