unable to communicate feather nrf52832 with ADS1194 using sp

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sripathi
 
Posts: 7
Joined: Sat Mar 12, 2016 3:08 am

unable to communicate feather nrf52832 with ADS1194 using sp

Post by sripathi »

I am trying to communicate to ADS1194 breakout by mikroe (https://www.mikroe.com/ecg-2-click )with the nrf52832 feather , my connections between the two boards are as follows
nrf Feather ------- MIKROE BREAKOUT
5V ------- 5V
3.3 ------- 3.3V
GND ------- GND
MISO ------ SDI
MOSI ------ SD0
SCK ------ SCK
PIN 07 -------DRDY
PIN 27 ------CS
PIN 11 -------RST

I am using the library https://github.dihe.moe/chepo92/ADS119X and arduino ide .

The above library works fine and i get the serial output , when i connect this breakout and the arduino UNO , but if i connect this to the nrf52832 feather I am getting no serial output . The code gets stuck at the initialization .
here is the code :

Code: Select all

#include <SPI.h>
#include "ADS119X.h" 

//  arduino pins 
//byte dataReady_Pin = 6;
//byte reset_pin = 5;
//byte cs_pin = 10 ; 
//  nrf pins 
byte dataReady_Pin = 11;
byte reset_pin = 7;
byte cs_pin = 27 ; 

ADS119X adc(dataReady_Pin,reset_pin , cs_pin);

// variables
bool dataReady = 0;
bool prev_dataReady = 0;
byte received ; 
boolean verbosity = 1; 
byte numberOfChannels;

// Serial comm
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];        // temporary array for use when parsing
int command [2]; 
boolean newData = false;

byte state = 1; 

int elapsed = 0 ;
long prevMicros = 0 ;

void setup() {
    Serial.begin(250000);  
    // adc begin() puts the ADS in a datasheet state, if verbosity is true it will print the ADS's register values
     Serial.println("inside adc") ;  
     
    if (adc.begin()) {
       Serial.println("inside adc begin") ;  
      numberOfChannels = adc.getNumberOfChannels();
      Serial.println("after get nuber of channels") ;
      if (verbosity) {
        Serial.print("ADS119X Conected") ; 
        Serial.println("") ;  
        displayRegs ();        
        Serial.print("Num Channels: ") ;         
        Serial.print(numberOfChannels) ; 
        Serial.println();  
      }    
    } else {
      Serial.print("ADS119X not started") ; 
    }
    
    // Stop continuous conversion, and send commands to configure 
    adc.sendCommand (ADS119X_CMD_SDATAC);
    adc.setAllChannelGain( ADS119X_CHnSET_GAIN_1);  
    adc.setAllChannelMux(ADS119X_CHnSET_MUX_NORMAL); 
    adc.setDataRate(ADS119X_DRATE_500SPS);     
    adc.sendCommand (ADS119X_CMD_RDATAC);
}

void loop() {

 // Check if the ADC conversion data is ready
 if (state) { 
    dataReady = adc.isDRDY();

    if (!prev_dataReady && dataReady) {
      elapsed = micros() - elapsed  ;
      //Serial.println(elapsed);
      elapsed = micros() ; 
      adc.readChannelData();
//    printStatus();
      printData();
      
    }
    prev_dataReady= dataReady;
 }

}



void printStatus (){
  Serial.print(adc.getStatus(),HEX);
  Serial.print(", ");
}

void printData (){
  for (int ch = 0; ch < numberOfChannels ; ch++)  //adc.getNumberOfChannels()
  {
    Serial.print(adc.getChannelData(ch)); 
    if (ch < numberOfChannels - 1 ) {
      Serial.print(","); 
    }
    
  }
  Serial.println("");
}


void displayRegs (){
  Serial.println("REGISTERS: ");
  for (int i = 0; i < adc.getRegisterSize() ; i++)
  {
    if (i < 0x10) {
      Serial.print(" ") ;
    }
     Serial.print("0x") ;
     Serial.print(i, HEX) ; 
     Serial.print(": ") ;
     print8bits(adc.getRegister(i)) ; 

  }
}

void print8bits(int var) {
  for (unsigned int bitpos = 0x80; bitpos; bitpos >>= 1) {
    Serial.write(var  & bitpos ? '1' : '0');
  }
  Serial.println();
}
Could you please help me out with this . Many thanks for your help .

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: unable to communicate feather nrf52832 with ADS1194 usin

Post by mikeysklar »

The Feather nRF52 is a 3v board. Your wiring and description of the problem makes it look like you have crossed the streams. Is your ADS1194 running on 5v? Can you keep it all 3v to avoid any issues. Obviously, the Arduino UNO is a 5v board which be happy to work with a 5v ADS1194.

User avatar
sripathi
 
Posts: 7
Joined: Sat Mar 12, 2016 3:08 am

Re: unable to communicate feather nrf52832 with ADS1194 usin

Post by sripathi »

thanks for your response , I have tried to connect ads1194 breakout to only 3v but its not responding .

the ads1194 breakout is working when both the 5v and the 3.3v inputs are provided to it . It was straight forward in the case of arduino uno . since the nrf feather doesnot have 5v output pin , I have connected the 5V input pin from ADS1194 to the USB POWER(VBUS) pin on the feather .

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: unable to communicate feather nrf52832 with ADS1194 usin

Post by mikeysklar »

Let's see your wiring. Please attach a photo showing the connections between the nRF52832 and ADS1194.

The USB line you are attaching to is 5v and if that goes to the ADS1194 Vdd you will not be able to have i2c communication without a level shifter.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”