Other Parts Discussed in Thread: ADS1299
Hi,
I'm trying to connect ADS1299 kit to Arduino Pro Mini 3.3v with SPI. At first,t I just want to read device ID but I couldn't. My connections are like below:
ADS1299_____Arduino mini
CLKSEL _____ Vcc
CLK_____pin 13
DOUT______pin 11
DIN______pin 12
DRDY______pin 8
CS_____pin 10
START_____Vcc
RESEST_____Vcc
My jumpers are like below:
And also I use this code:
#include "ads1298.h" #include "adsCMD.h" #include <SPI.h> int gMaxChan = 8; int gIDval = 0; const int kPIN_LED = 13; #define WiredSerial Serial void setup(){ using namespace ADS1298; //prepare pins to be outputs or inputs pinMode(IPIN_CS, OUTPUT); pinMode(PIN_START, OUTPUT); pinMode(IPIN_DRDY, INPUT); pinMode(PIN_CLKSEL, OUTPUT);//*optional pinMode(IPIN_RESET, OUTPUT);//*optional //pinMode(IPIN_PWDN, OUTPUT);//*optional //start Serial Peripheral Interface SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV16); //forum.pjrc.com/.../1156-Teensy-3-SPI-Basic-Clock-Questions SPI.setDataMode(SPI_MODE1); //Start ADS1298 delay(1000); //wait for the ads129n to be ready - it can take a while to charge caps adc_send_command(SDATAC); // Send SDATAC Command (Stop Read Data Continuously mode) delay(10); adc_send_command(START); delay(10); // Determine model number and number of channels available gIDval = adc_rreg(ID); //lower 5 bits of register 0 reveal chip type //start serial port WiredSerial.begin(115200); //use native port on Due while (WiredSerial.read() >= 0) {} //forum.arduino.cc/index.php Serial.println(ADS1298::RREG | ID); delay(200); // Catch Due reset problem pinMode(kPIN_LED, OUTPUT); } void loop() { WiredSerial.print("Device Type (ID Control Register): "); WiredSerial.print(gIDval); WiredSerial.print(" Channels: "); WiredSerial.println(gMaxChan); digitalWrite(kPIN_LED, HIGH); // turn the LED on (HIGH is the voltage level) if (gMaxChan > 0) delay(500); //long pause if OK else delay(50); //rapid blink if error digitalWrite(kPIN_LED, LOW); // turn the LED off by making the voltage LOW delay(500); }
But as I said, I just get 0x00 as a result. Would you please help me with that?