Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

ADS124S08EVM: Interfaced ADS124S08 EVM with arduino and logging data to SD card problem

Part Number: ADS124S08EVM
Other Parts Discussed in Thread: ADS124S08

Hello sir,

I have tried logging the data of ADS124S08 EVM to SD card using arduino, but data is not logging to a file which is present in SD card. I have attached my code here. I am using voltage source (6V) as a input to EVM. But I am able to get the data from EVM using arduino but logging is not happening.

Thanks

Regards

Sushmita Chaudhary

4848.New Text Document.txt
#include <SPI.h>
#include <SD.h>
#include <TimerOne.h>
#define START 6
#define RESET 7
#define CS  8
#define SD_CS_PIN 53

int32_t stat;
SPISettings settings1(4000000, MSBFIRST, SPI_MODE1);

void setup() {
  Serial.begin(9600);
  Serial.print("Initializing SD card...");

 
  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("Card failed, or not present");
    
    return;
  }
  Serial.println("card initialized.");
  
SPI.begin();

pinMode(CS,OUTPUT);
pinMode(RESET, OUTPUT);
pinMode(START,OUTPUT);
digitalWrite(RESET , HIGH);
delay(5); 

SPI.beginTransaction(settings1);
digitalWrite(CS, LOW);
digitalWrite(START,LOW);
}

void loop() {
  
for(int i=0;i>=0;i++)
{
  
if(i==0){
SPI.transfer(0x42); // WREG register adress
SPI.transfer(0x07); // WREG byte number -1
SPI.transfer(0xAC); // WREG write AIN10-AINCOM,(1010 1100) binary,MUXP and MUXN selection
SPI.transfer(0x08); // gain =1
SPI.transfer(0x14); // DATA RATE 20 SPS
SPI.transfer(0x19); //REF on (0001 10-ref 01)
SPI.transfer(0x00); // IDAC MAG
SPI.transfer(0xFF); // IDAC MUX
SPI.transfer(0x00);// Vbias
SPI.transfer(0x12);// Timeout bit second =1 ,default is 10h
SPI.transfer(0x08); // start converting command
delay(1);
}
else
{
digitalWrite(CS, LOW);
SPI.transfer(0x12); //RDATA command 
stat = SPI.transfer(0) ;
stat = (stat<<8) | SPI.transfer(0); 
stat = (stat<<8) | SPI.transfer(0);
digitalWrite(CS, HIGH);
if (stat & 0x800000)
{
  stat = (stat | 0xFF000000);
}

File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
    dataFile.println(stat);
    dataFile.close();
  }

  else {
    Serial.println("error opening datalog.txt");
  }
}

}
SPI.endTransaction();
}

  • Hello,

    It sounds like you're properly communicating with the ADS124S08 device on the EVM but the issue lies in the way you're storing data in your Arduino code.  Since it doesn't sound like you're have challenges with the ADS124S08 we're going to ask that you consult the Arduino community to find answers about the data logging challenges.