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.
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]); } }
Hello sir.
Thanks for your reply.
I am able to get the ID value as 0(below i attached my sample code for this).
So ADS 1298 is communicating with Arduino .But issue is that i can not get specific channel data on serial monitor.also i have checked your suggested section and forum for basic data capture process of ADS 1298 and apply all configuration in software.But still not get Channel data.
Also i have another question is that is all 8 channel active is same time.if yes then Arduino UNO board is capable of receiving all channel data simultaneously?
Can anyone please answer my questions...
#include "ads1298.h" #include "adsCMD.h" #include <SPI.h> void setup(){ using namespace ADS1298; pinMode(IPIN_CS, OUTPUT); pinMode(PIN_START, OUTPUT); pinMode(IPIN_DRDY, INPUT); pinMode(IPIN_RESET, OUTPUT); SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV4); SPI.setDataMode(SPI_MODE1); Serial.begin(115200); adc_send_command(SDATAC); delay(500); } void loop() { int ID; digitalWrite(IPIN_CS, LOW); SPI.transfer(0x20); delayMicroseconds(10); SPI.transfer(ID); delayMicroseconds(10); digitalWrite(IPIN_CS, HIGH); Serial.println(ID); delay(100); }
it may be helpful in my project.
Hello,sorry for delay from my side
I want to use internal clock of ads 1298 so i set JP24 (2-3)as per user guide of ADS1298 ecgfe-pdk .Is it ok?
and as per your suggestion i connected supply to
GND on AVSS-JP20.2
5V on AVDD-JP2.2
3.3V on DVDD-JP19.1
but when i measure power supply on given test point then it give 3.3 V correctly but when i measure 5V it shows me zero.
Then I modified power supply connection as like
J4.5 - GND
j4.9 - 3.3 V
J4.10 - 5 V
and when i test power supply on given test point it gives me 3.3 V and 5.0 V correctly.So power supply issue is solved i think?
is ADS 1298 is capable of transmitting data @ rate of 1 MHz(SPI_CLOCK_DIV16);) as i stetted in code?
It seems look that hardware connection is correct as per my concerns So there is a problem in a code. Here i upload my code.after long time i can not find correction in my code.Can you please tell me correction in my code (for capture basic id of ads 1298 and print on to serial monitor of arduino).
#include "ads1298.h"
#include "adsCMD.h"
#include <SPI.h>
int gMaxChan = 8;
int gIDval = 0;
int activeSerialPort = 0;
void setup()
{
using namespace ADS1298;
pinMode(IPIN_CS, OUTPUT);
pinMode(PIN_START, OUTPUT);
pinMode(IPIN_DRDY, INPUT);
pinMode(IPIN_RESET, OUTPUT);
digitalWrite(PIN_START,LOW);
digitalWrite(IPIN_CS, HIGH);
delay(500);
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV16);
SPI.setDataMode(SPI_MODE1);
Serial.begin(115200);
while (Serial.read() >= 0) {}
uint8_t gMaxChan = adcSetup();
if (gMaxChan == 0) {
while(1) {
Serial.println("ADC Error");
delay(1000);
}
}
Serial.print("ADC detected has ");
Serial.print(gMaxChan);
Serial.print(" channels\n");
gMaxChan = adcSetup();
if (gMaxChan == 0) {
while(1) {
Serial.println("ADC Error");
delay(1000);
}
}
Serial.print("ADC detected has ");
Serial.print(gMaxChan);
Serial.print(" channels\n");
}
int8_t adcSetup()
{
using namespace ADS1298;
digitalWrite(IPIN_RESET, HIGH);
delay(1000);
digitalWrite(IPIN_RESET, LOW);
delayMicroseconds(1);
digitalWrite(IPIN_RESET, HIGH);
delayMicroseconds(9);
adc_send_command(SDATAC);
delayMicroseconds(5);
adc_wreg(CONFIG3, RLDREF_INT | PD_RLD | PD_REFBUF | CONFIG3_const);
adc_wreg(RLD_SENSP, 0x01);
adc_wreg(RLD_SENSN, 0x01);
adc_wreg(GPIO, 0x00);
adc_wreg(CONFIG1, HIGH_RES_1k_SPS);
adc_wreg(CONFIG2, INT_TEST);
adc_wreg(CH1SET, ELECTRODE_INPUT | GAIN_12X);
for (int i = 2; i <= 4; i++) {
adc_wreg(CHnSET + i, PDn | SHORTED);
}
int IDval = adc_rreg(ID) ;
}
void loop()
{
Serial.print("Device Type (ID Control Register): ");
Serial.print(gIDval);
Serial.print(" Channels: ");
Serial.println(gMaxChan);
}
Please help me ...
Hello sir ,
YES I am able to see DRDY signal on oscilloscope it is confirm that ADS1298 IC is working correctly. Below i attached picture of my DRDY,DIN,DOUT and CLK signal results which is taken from oscilloscope display.
So can you verify that there is no h/w issue.So i will work on s/w side.
1>DRDY Sgnal on Oscilloscope - PIN no. - 47 of ADS 1298
2> DIN signal - PIN no. - 34
3> DOUT Signal with ref. to GND(yellow line is ground line.) - PIN 43 of ADS 1298
4> CLK signal of ADS 1298 with reg. to GND (Pin 37)
Please help me..
Hello sir
When i connects ADS 1298 board with Host MMB0 board and try to check ECG signal on TI software then obtain the results look like below i attached picture.I used ECG simulator to get signals.
and when i remove ECG simulator then also get same signal on ECG display(software).
what is the reason behind it?
Is my ads 1298 ic is damaged?
Picture - with ECG simulator signal on s/w.
Hello sir
When i See the SPI results on logic analyzer.Then Results might be like this.But MISO signal is remain unchanged.What is reason behind it?
also notification appear on logic s/w screen that "The initial(ideal clock) appears on the screen does not match the setting".Is Clock signal is OK?
Thanks for helping..