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.

Compiler/ADS7250: ADS7250

Part Number: ADS7250

Tool/software: TI C/C++ Compiler

Hello, 

I'm trying to read data using an Arduino with this chipset, and can't seem to get clean data from SPI & SPI1 using the same SCK.  I have no MOSI wired only MISO on SPI and SPI1 and I'm only using one SCK and SS for both. I'm following the diagram bit can't seem to get data from the chip, I'm not sure what address I need to send to get back the values, and then convert them to useable numbers. Here is my code:

byte ssPin = D5;
byte ADCA;
byte ADCB;
byte addressToRead = 0x00; // Not sure what this shoudl be from datasheet

void setup(){
  Serial.begin(115000);
  pinMode (ssPin, OUTPUT);
  SPI.setBitOrder(LSBFIRST);
  SPI1.setBitOrder(LSBFIRST);
  SPI.setClockSpeed(24, MHZ);
  SPI1.setClockSpeed(24, MHZ);
  digitalWrite (ssPin, HIGH); 
  SPI.begin(); 
  SPI1.begin(); 
}

void loop(){
  digitalWrite (ssPin, LOW); // select the device
  SPI.transfer (addressToRead); 
  SPI1.transfer (addressToRead);
  ADCA = SPI.transfer(0x0); 
  ADCB = SPI1.transfer(0x0); 
  digitalWrite (ssPin, HIGH); 
  Serial.print(ADCA);
  Serial.print(ADCB);  
}

  • Hello,

    Would you please capture an oscilloscope shot with the digital communications? Having a visual representation of what is actually happing on the digital communications is very helpful to compare to what is expected.  Be sure to include CS, SDO and SCLK, SDI if it was applicable

    Also, suggest using known DC input values to compare the output data to the expected input data.

    This device is an SPI device thus it does not have an address associated to it, CS is what enables the device.

    If this command has to do with the Arduino, then I will need to get that team involved in this.

    As for how to interpret the data from the ADC, I suggest looking at page 22 to 23 on the datasheet

    Regards

    Cynthia

  • I don't have a scope with me right now. WIll have to wait till next week.

    How would you write code to just read one SPI input from ADS7250.

    What I'm doing is setting up SPI on an Arduino like device and then manually toggle CS low where I then use SPI.transfer(0x00). I'm confused about how to make use I'm holding the CS low for 30 clock cycles. I see on page 24 of the datasheet that the first 15 clock cycles are empty while it takes a reading and then the next 12bit represents the ADC value using MSB. 

    Once I can read one ADC I assume I can try the same thing using the SDO_B to SPI1_MISO on the nRF52840 device I'm using.

    Nicholas 

  • This device does not have registers to write to, thus there is no SDI, or SPI input.

    if you mean how to read the conversion result, all you need is CS low and 32 SCLKs, this will output the sample data at the 15 SCLK.

    I suggest using known DC inputs at each input to compare expected output with the actual output. Also use different DC input values at each input, ex InA=1V, and InB = 2V.

    The scope would be helpful to see if data is actually coming out from the ADC, and just being read properly by the master

    The method you are doing should work

    Regards

    Cynthia

  • Here is a logic analyzer screens shot of the current SCLK and MISO with CS (SS) 

    From the datasheet, I get that I need to hold  CS low for 32 CLK cycles, and after the first 15 clock cycles teh ADC will spit out in my case 12 bits of data that represent the ADC reading based on Equation 6. 

    What I'm struggling with is that I'm using a HAL that has SPI and SPI1 functions to read teh data, and I'm not sure I can use one CLK for both buses. Particle SPI

    I'm still reading up on this, but from what I'm seeing I won't be able to read SDO_A & B with a single CS and CLK.. :( Let me know if you come to the same conclusion. 

  • I understand. Since the micro you are using is not a TI product, we cannot speak for the capabilities of the device. I suggest reaching out to that public community for support. There are multiple public forums dedicated to software development or  Arduino support. 

    As for the ADC, one SCLK line is sufficient, and both SDO will output simultaneously. If you have two input pins available on the master, then you could read both and this should work. 

    If you need the two buses then I cannot help you with that direct implementation 

    Regards

    Cynthia

  • Understand, 

    I use both buses, SDO_A, and ASDO_B reading current and voltage measurements respectively. I'm able to get data only after some sketchy bit bagging. Here is the code I'm using now. 

     digitalWrite (CS_ADC_ISOLATOR, LOW);
      for (int i = 0; i < 32; i++) {
          digitalWrite(SCK, HIGH);
          digitalWrite(SCK, LOW);
          resa <<= 1;
          resb <<= 1;
          resa |= digitalRead(SDI_A);
          resb |= digitalRead(SDI_B);
      }
      digitalWrite (CS_ADC_ISOLATOR, HIGH);
      Serial.print("A: "); Serial.println(resa);
      Serial.print("B: "); Serial.println(resb);

    This has gotten me close enough to use the data and convert to values, but still not ideal as it doesn't use SPI hardware on the Nordic nRF52840 SOC which according to the datasheet has QSPI. Do you have any example code for a CC13xx series chip? I have a number of TI MCUs and might be able to extrapolate backward to a better solution if I see how it's done on anouther platform.  

    Best,

    Nicholas 

  • I haven't read all the technical details here but is the CC13x2 with up to 6 MHz SPI master fast enough for this?