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.

ADS8332: SPI communication with Arduino

Part Number: ADS8332

Hi,

Below is the code I am using to test the SPI communication between Arduino Mega 2560 v3 and ADS 8332.

For starters, I am just trying to read the CFR to establish communication.

I am getting '0' as serial output for "Serial.println(SPI.transfer16(0XC000));" command. 

Here are my voltages:

VBD (PIN 13) - 3.3V

VA (PIN 14) - 5V

REF+ (PIN 15) - 3V

\RESET (PIN 5) - 3.3V

Code:

#include <Arduino.h>
#include <SPI.h>

#define CS 13
#define CONVST 12

int data;

void setup() {

SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE2));
SPI.begin();
Serial.begin(115200);
pinMode(CS, OUTPUT);
digitalWrite(CS, HIGH);

digitalWrite(CS,LOW);
SPI.transfer16(0xFFFF);
Serial.println("Uploaded CFR");
digitalWrite(CS,HIGH);
delayMicroseconds(2);
digitalWrite(CS,LOW);
Serial.println(SPI.transfer16(0XC000));
digitalWrite(CS, HIGH);
}

void loop() {
digitalWrite(CONVST, LOW);
delayMicroseconds(2);
digitalWrite(CONVST, HIGH);
delayMicroseconds(2);
digitalWrite(CS, LOW);
data = SPI.transfer16(0xD000);
digitalWrite(CS, HIGH);
Serial.println(data);
delay(1000);
}