Hi,
I am using ADS8688 with my arduino due, if i set channels 0-3 to gnd i get
this as answear, but i expect something about 32768.
CH0: 64
CH1: 64000
CH2: 0
CH3: 256
CH0: 192
CH1: 63904
CH2: 32
CH3: 64
CH0: 0
CH1: 63520
CH2: 752
CH3: 63552
my setup an code is.
RST/PD -> 3V3
REFSEL -> GND
AVVD -> 5V
DVDD -> 3V3
daisy - > GND
REFGND - > GND
my code is:
#include "SPI.h"
#define CS 49
int result0;
int result1;
int result2;
int result3;
void setup() {
pinMode(CS, OUTPUT); // Chip Select als Output
digitalWrite(CS, HIGH); // CS High
SPI.begin(); // SPI start
SPI.setDataMode(SPI_MODE1); // SPI Mode 1
SPI.setBitOrder(MSBFIRST);
Serial.begin(9600);
digitalWrite(CS,LOW);
SPI.transfer16(0x8500); // device Reset
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0xA000); // Auto Channel with Reset
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x010F); // channel 0-3 enable
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x02F0); //Channel 4-7 Power Down
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0300); // SDO Output format MSB first
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0501); // Vref Channel0 +- 1.25 * 4.096
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0601); // Vref Channel1 +- 1.25 * 4.096
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0701); // Vref Channel2 +- 1.25 * 4.096
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0801); // Vref Channel3 +- 1.25 * 4.096
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0xA000); // start sampling
digitalWrite(CS,HIGH);
}
void loop() {
digitalWrite(CS,LOW);
SPI.transfer16(0x0000); // start sampling
result0 = SPI.transfer16(0x0000); // Channel 0 Data
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0000); // start sampling
result1 = SPI.transfer16(0x0000); // Channel 1 Data
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0000); // start sampling
result2 = SPI.transfer16(0x0000); // Channel 2 Data
digitalWrite(CS,HIGH);
digitalWrite(CS,LOW);
SPI.transfer16(0x0000); // start sampling
result3 = SPI.transfer16(0x0000); // Channel 3 Data
digitalWrite(CS,HIGH);
Serial.print("CH0: ");
Serial.println(result0);
Serial.print("CH1: ");
Serial.println(result1);
Serial.print("CH2: ");
Serial.println(result2);
Serial.print("CH3: ");
Serial.println(result3);
Serial.println(" ");
delay(1000);
}
I do not know whether the device is defect or my code is wrong
Thanks